Hello fellow developers! ![]()
Recently, I have been trying to calculate the time an object with a constant velocity needs to travel a linear path, using the velocity formula:
Anyways, I proceeded to make two parts
- Part 1: Anchored (reach)
- Part 2: Not anchored, has Linear Velocity (mover)
The ‘mover’ part with the velocity (blue arrow in image) should go toward the ‘reach’ part
NOTE: They both share the same axis, so the velocity direction is correct
Other properties for the LinearVelocity:
Now the real question is,
Why is the time calculated not accurate??
- Here’s the code:
local mover = workspace.mover
local reach = workspace.reach
local dis = (mover.Position - reach.Position).Magnitude
local speed = mover.LinearVelocity.VectorVelocity.Magnitude
task.delay(dis/speed, function()
print("reached")
end)
- It would print ‘reached’ before it had actually reached, maybe at around 80% of the path
- I was not able to figure out why this is happening, my calculations should be right
Things I have tried to fix the issue:
- I tried removing gravity from game settings
- I tried using other body movers
- I tried AssemblyLinearVelocity
None of the above seemed to fix my issue,
If you can help, please do I really appreciate it ![]()
Thanks!


