How to fix Humanoid:MoveTo() stopping at 8 seconds?

I’m making a Tower Defense game and im using this script to move through the path, but the problem is that is stops 8 seconds in, ive looked through devforum and google and cant find a solution. Please help :slight_smile:
my zombie code (server):

local zombie = script.Parent
local waypoints = script.Parent.Parent.Waypoints

for waypoint=1, #waypoints:GetChildren() do
	zombie.Humanoid:MoveTo(waypoints[waypoint].Position)
	zombie.Humanoid.MoveToFinished:Wait()
end
zombie:Destroy()
2 Likes

my current solution is to just make waypoints in the middle of long paths, but i dont want to keep doing this

2 Likes

Looking through the documentation seems like the 8 second timeout is built in.

Seems like the only solution is to implement a manual waypoint reached event.

2 Likes

Maybe you could do this, but it is probably less optimized than adding new waypoints in middle path.

for waypoint = 1, #waypoints:GetChildren() do
    repeat task.wait(0.1)
	    zombie.Humanoid:MoveTo(waypoints[waypoint].Position)
    until (zombie.HumanoidRootPart.Position - waypoints[waypoint].Position).Magnitude <= 3
end
3 Likes