The line is showing where they’re skipping the path. They stop for like 1 second the skip it.
What solutions have you tried so far?
I’ve tried seeing if the timing was wrong on the pathfinding or the block they go to was in the wrong spot but it wasn’t. Here’s the script if you need it.
local hum = script.Parent:WaitForChild("Humanoid")
local torso = script.Parent:WaitForChild("Torso")
local nodes = game.Workspace.Path1:GetChildren()
table.sort(nodes, function(nodeA, nodeB)
local nodeNumberA = string.match(nodeA.Name, "%d+")
local nodeNumberB = string.match(nodeB.Name, "%d+")
return tonumber(nodeNumberA) < tonumber(nodeNumberB)
end)
for _, node in ipairs(nodes) do
hum:MoveTo(node.Position)
local distance = (torso.Position - node.Position).Magnitude
wait (distance / hum.WalkSpeed)
end
That is an error with my faster zombies. The normal zombies stop even earlier in the path and skip it and I don’t know why.
Hello so i’ve been a dev for 5 years and i experienced this. i had to change my code to this:
local zombie = script.Parent
local waypoints = workspace.Waypoints
for waypoint=1, #waypoints:GetChildren() do
zombie.Humanoid:MoveTo(waypoints[waypoint].Position)
zombie.Humanoid.MoveToFinished:Wait()
end