Hello,
I wanted to learn and try to use BodyVelocity but there isn’t much help. I don’t understand the hub so how do I use it? Thanks,
Hello,
I wanted to learn and try to use BodyVelocity but there isn’t much help. I don’t understand the hub so how do I use it? Thanks,
Hi!
There already appears to be a thread asking the same “question”:
I think the response you will find there will be helpful
If not feel free to reply
I still don’t understand how to make a part move.
First, read the solution to the post that @Forcoy linked in order to understand BodyVelocity. To make the BodyVelocity actually work, you need to set the parent of it to whatever part you want to move. Something like this.
local part = Instance.new("Part")
part.Parent = workspace
local bodyVelocity = Instance.new("BodyVelocity")
bodyVelocity.Velocity = Vector3.new(0,0.5,0)
bodyVelocity.Parent = part
So you just made the part go 0.5 studs up on the y axis on the part forever?
Until you destroy the BV, yes.
Ooh, but what the p and maxforce properties do?
P is how fast the part goes I think, and maxforce is the maximum force it can apply to the part.
A BodyVelocity
is basically a BasePart mover
You can configure a couple of properties with it, such as:
Velocity
can move the part where you want it to move
MaxForce
, which can adjust the amount of each axis force (X, Y, Z) you put into the part into obtaining it’s receiving Velocity
P
determines how much base force you’ll use to reach the desired Velocity
goal
Ok. But why isn’t my script working. It’s supposed to constantly move the part up by 5 studs.
local part = game.Workspace.Part
local BV = part.BodyVelocity
BV.Velocity = Vector3.new(0, 5, 0)
Ah, this is possibly due to the MaxForce
being set low
The MaxForce
property by default is set to 4000, 4000, 4000 (I believe), and it won’t work cause that property is dependent on how heavy your total mass is on what part you want to move, so you might need to change that to
local part = game.Workspace.Part
local BV = part.BodyVelocity
BV.MaxForce = Vector3.new(20000, 20000, 20000)
BV.Velocity = Vector3.new(0, 5, 0)
You can try this and see if you get anything different
No, it’s still in the same position…
Is the part anchored? If it is, it won’t work in relation to the Velocity
property cause Anchored
is literally “locking it in place” from physics interacting with it
Hello there is a documentation on BodyVelocity that you can read which gives detailed explanations BodyVelocity | Roblox Creator Documentation
Yeah thanks it worked. So if I want to make the part go faster, would I change the maxforce?
Hey, just a side note for anyone looking at this I highly recommend to switch on using LinearVelocity as BodyVelocity is now deemed as DEPRECATED, I’ll still keep the old post going though at the bottom of my post
You would do the same thing as you would for handling a BodyVelocity
, except the only difference is that you’d need to create an Attachment to be able to properly connect the LinearVelocity
Instance for the Part
local Part = workspace:WaitForChild("Part")
local A = Instance.new("Attachment")
A.Parent = Part
local LV = Instance.new("LinearVelocity")
LV.Attachment0 = A -- We want to be able to set our Attachment0 to the Part inside the Attachment
LV.MaxForce = 20000 -- Instead of a Vector3, we can just simply set a number for this MaxForce property
LV.VectorVelocity = Vector3.new(0, 250, 0) -- "VectorVelocity" is what you'd want
LV.Parent = Part
Nah, you’d increase the Velocity
property since that’s the current speed of the Part that you’re currently moving right now
If I put this:
local part = game.Workspace.Part
local BV = part.BodyVelocity
BV.MaxForce = Vector3.new(20000, 20000, 20000)
BV.Velocity = Vector3.new(0, 250, 0)
Yeah that part will enter the cosmos of space before you know it
Another side note, but if you want a guaranteed Velocity
movement, set the MaxForce
property to
BV.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
math.huge
is simply a number that is the size of Jupiter (Or in other words, it’s massive)
i still somewhat don’t get it, and cant find one where the example is a player/character, a example usin that would be heavily appreciated