LineVelocity problem

Hello. I decided to check is the object moves exactly at the speed as set in LineVelocity parameter in LinearVelocity.
I measured speed using Vector3:

while true do
    pos1 = script.Parent.Part.Position
    wait(1)
    pos2 = script.Parent.Part.Position
    print((pos2-pos1).Magnitude)
end

For example, I set the speed in LineVelocity to 50 studs/s, and calculated speed is frequently slightly higher (in this case approx. 50.8 studs/s). Why this occurs? Is this fixable?

its your measuring not the constraint, wait(1) never waits exactly 1 second, it waits at least 1 and then until the next frame, so you get something like 1.016s and 50 x 1.016 is your 50.8, use the time it actually waited, local dt = task.wait(1) and divide the distance by dt, or just print Part.AssemblyLinearVelocity.Magnitude

1 Like

Show me a code of use of local dt = task.wait(1)