Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Anybody here a math expert? (Velocity)

Im trying to use BodyVelocity to move a brick from the starting position to the target (I need to use bodyvelocity, I can't use body positioning or rocket propulsion for this)

But does anybody know the mathematics involved to calculate the velocity?

So if my starting position is Vector3.new(84.146, 3.175, -41.716)

and my target is Vector3.new(0.267, 7.535, 213.184)

and my maxforce is Vector3.new(4e+006,0,4e+006)

does anybody know how to get the velocity to make the brick move to the target?

1 comment

0

Velocity is more of a physics thing, not math... From what I know it is ((final point - original point) / time) so I would say your target is final, your starting is original and your MaxForce is time, I am not sure how to get the velocity from this though, not sure though

1 answer

We don't have all the information. How fast do you want it to get from point A to point B? Once you decide that, you can plug it into the equation for velocity, which is really simple.

velocity = distance / time

Where distance is the distance between your two Vector3s:

distance = (pointA.Position - pointB.Position).magnitude

3 comments

0

thank you but the velocity in BodyVelocity is an actual Vector3 so how would Velocity = Distance / 2 get a vector3? O_o

0

For an easy solution, try calculating the velocity in each of the three dimensions (x, y, and z), and apply the velocity individually at the same time

0

thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.