I am writing a script for a tower defense game where the zombie walks from point to point.
Whenever I run the script, the zombie walks toward its next waypoint for about 5 second, before reaching its point it turns toward the next point.
I have tried adjusting the wait time on the script but the zombie then freezes at the waypoint for a few seconds. How do I get the zombie to make contact with the point then immediately head toward the next?
Image of Output printing Waypoint and Zombie position at MoveTo switch, path and zombie final position:
Script used to move Zombie:
Summary
local fein = script.Parent
local waypoints = game.Workspace.Board.PlayerPath.Waypoints
for waypoint=1, #waypoints:GetChildren() do
fein.Humanoid:MoveTo(waypoints[waypoint].Position)
fein.Humanoid.MoveToFinished:Wait()
print('Waypoint Position:')
print(waypoints[waypoint].Position)
print('Zombie Position:')
print(fein.HumanoidRootPart.Position)
end