Hello. My npc is coded to go to one waypoint, and then another (the waypoints are 2 parts in a workspace folder called "waypoints")
He goes to the first waypoint just fine, but stops when almost reaching the second waypoint. Apparently its too far for him or something.
I don't know how to get him to the end. Help would be appreciated!
my code:
local npc = script.Parent local waypoints = workspace.Waypoints:GetChildren() local waypoint = 0
function move()
local choosing = waypoint + 1
local destination = waypoints[choosing]
npc:MoveTo(destination.Position)
npc.MoveToFinished:Wait()
nextstep()
end
function nextstep()
waypoint = waypoint + 1
if waypoint == 4 then
waypoint = 0
end
move()
end
