How to move a part to a point with bodyvelocity

So basically I’m trying to move a part to another part’s position using body velocity. I tried using bodyPosition but I don’t understand it and the wiki is down. This script nearly works but it’s off by a small, small amount.

local StartingDistance = (script.Parent.Parent.End.Position-script.Parent.Position).magnitude
script.Parent.BodyVelocity.Velocity = (script.Parent.Parent.End.Position-script.Parent.Position).Unit
wait(StartingDistance)
print((script.Parent.Parent.End.Position-script.Parent.Position).magnitude) --changes based on the distance
script.Parent.BodyVelocity.Velocity = Vector3.new(0,0,0)


here’s a repro if you don’t understand.

does anybody know how to find the small number to fix it?

3 Likes

BodyPosition is more accurate, it allows you to input the finishing position of where it will go. Next, the object will attempt reaching that position depending on its other properties.

For the incredibly small errors, it’s hard to fix due to floating point error. Nothing we can really do to fix consistently.

ok then, I’ll take your word for it, the wiki is back up for me so I’ll have a read.