MoveTo() skips some waypoints

Hello!
I’m making a tower defense game and I made the enemies have to pass each waypoint to get to the end. but I have a small big problem and that is that if the enemy is slow he skips waypoints. Does anyone know if this can be fixed?

sorry for the quality but they only allow 10MB

1 Like

This is because MoveTo times out after 8 seconds if it is not finished. As a way to counteract this (I made it when I was having the problem myself), I repeated the MoveTo until it was properly finished.

repeat
	hum:MoveTo(waypoints[waypoint].Position)
	local reached = hum.MoveToFinished:Wait()
until reached

(Edited it to work for your script)

6 Likes

thanks a lot!! I’ve been trying to fix this for days :raised_hands: