Humanoid:MoveTo() is stopping before end destination for some NPCs

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I’d like my regular zombie NPCs to reach their end destination.

  2. What is the issue? The regular zombie NPCs are stopping before they reach the waypoint, while the other zombies are going to the waypoint normally.

  3. What solutions have you tried so far? I’ve looked online and haven’t found that many solutions yet.

Here is my current code so far:

local humanoid = zombie:WaitForChild("Humanoid")
local waypoints = map.Waypoints

for i=1, #waypoints:GetChildren() do
	humanoid:MoveTo(waypoints[tostring(i)].Position)
	humanoid.MoveToFinished:Wait()
end

Here is a video demonstrating the issue:
https://gyazo.com/f603aae3bac4fb1500975172a0487552

1 Like

The waypoints could be too far apart, move to has an 8 second timeout. This article may help: Humanoid:MoveTo

You were right, thank you! I made it so the MoveTo function was ran again on the last waypoint after the NPC had stopped.