So I am trying to make a tower defense game and I am stuck with one problem for 2 hours , idk how to solve it , so basically I want the zombies to get thru every waypoint , but the slow ones are not going all the way and touching the waypoints , they are going 75% of the way and they go to the other one without touching the correct waypoint
function mob.Move(mob, map)
local humanoid = mob:WaitForChild("Humanoid")
local waypoints = map.Waypoints
for waypoint=1, #waypoints:GetChildren() do
mob.MovingTo.Value = waypoint
humanoid:MoveTo(waypoints[waypoint].Position)
humanoid.MoveToFinished:Wait()
end
end
I rlly don’t know how to solve this , I am losing interest in continuing this game , I would appreciate some help , thank you for your time!
MoveTo stops working after around 7 seconds and since your zombie move slow, the zombies might not reach the waypoint before MoveTo stops working becaude they are too slow.
To be precise the ‘MoveTo’ method of ‘Humanoid’ instances has a timeout of eight seconds, after this timeout the Humanoid's ‘MoveToFinished’ event/signal will be fired, passing/returning a value of false indicating that the ‘Humanoid’ didn’t reach its intended goal.