:MoveTo() not working correctly

What is meant to happen is that the zombies move to each waypoint.


After the 4th waypoint, it works again somehow.

Here is the script:

local zombie = script.Parent

for i = 1, #workspace.Waypoints:GetChildren() do
	local part = Instance.new("Part", workspace)
	local waypoint = workspace.Waypoints:FindFirstChild("Waypoint".. i)

	part.Size = Vector3.new(1,1,1)
	part.Shape = Enum.PartType.Ball
	part.Material = Enum.Material.Neon
	part.Anchored = true
	part.CanCollide = false
	part.Position = waypoint.Position

	zombie.Humanoid:MoveTo(waypoint.Position)
	zombie.Humanoid.MoveToFinished:Wait()
end

u probably indexed your waypoints in a wrong way recheck the waypoints folder.

Already checked this, doesn’t seem to be a problem

I’ve tested your exact same script and works perfectly with this folder:

image

Check the position and wait time with prints, because everything in the script is fine.

1 Like

Yeah, I don’t know whats wrong. The script says right after I run that the first waypoint has been reached for some reason.

0:05-0:13 MoveToFinished has an 8-second timeout