How to change the value of velocity in BodyVelocity?

I’ve been trying to figure out how to change the value using script but all I’m finding is what BodyVelocity does.

If someone could give me a video or page from the Roblox API that would be great.

https://developer.roblox.com/en-us/api-reference/property/BodyVelocity/Velocity

How can I use it in a script?

I tried this but it doesn’t seem to work

script.Parent.BodyVelocity.Velocity = (0,2,0)

Sorry for being so stupid

is this scripts parent the body velocity?

image

make the script a child of the body velocity

Script:

script.Parent.Velocity.Y = 10

Capture111

do it like this

script.Parent.Velocity = Vector3.new(0,10,0)
2 Likes

Is the Part Anchored? If it is you just turn it into a conveyor belt with a BodyVelocity.

What is the MaxForce in your BodyVelocity. Is it possible your changing it, but there’s no force to move it?

I’m assuming this Part would be in the workspace?

script.Parent.BodyVelocity.Velocity = Vector3.new(0,20,0) --This will make the part move up
script.Parent.BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)

If you’re trying to make the script work from inside the Part and not parented inside the BodyVelocity,

Velocity

is a Vector3 property which has 3 arguments (Or variables): X, Y and Z

MaxForce

Limits the force on what your “Velocity” property currently is atm

You can learn more about Vector3 here to have a better understanding:

2 Likes

You can’t assign it like that. Velocity is a Vector.

Instead you can do something like this:

script.Parent.BodyVelocity.Velocity = Vector3.new(0,2,0)
2 Likes