Hey, I’ve been trying to figure this out but I just can’t get around it…
How would I go about calculating how long it would take an NPC to get from PointA to PointB.
Hey, I’ve been trying to figure this out but I just can’t get around it…
How would I go about calculating how long it would take an NPC to get from PointA to PointB.
If you know speed, you can get the distance between pointa and pointb and just do simple calculations.
Everyone knows Speed = Distance/Time
therefore with a little bit of algebraic manipulation, Time = Distance/Speed
Well, take the total distance and divide it by the speed. For example, 50 studs at 5 studs per second would take 10 seconds. If you’re using pathfinding, just do this for each waypoint and add up the time.
Stated better here
Yea Ive calculated the distance with .Magnitude, I’ll try this thank your for your help.
Thank you for this.
local Distance = (HumanoidRootPart.Position - Target.Position).Magnitude / Humanoid.WalkSpeed