#Please help with pathfinding

1 messages · Page 1 of 1 (latest)

earnest charm
#

Trying to follow a gnomecode video for tower defense path finding and the guy just likes to get stuck on the first waypoint please help
Code:
local normal = script.Parent
local waypoints = workspace.Waypoints

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

tough magnet
#

Use GetChildren() to get a list, then index that.

local normal = script.Parent
local waypoints = workspace.Waypoints:GetChildren()

for i = 1, #waypoints do
normal.Humanoid:MoveTo(waypoints[i].Position)
normal.Humanoid.MoveToFinished:Wait()
end

Tell me if that works, if not tell me the issue.

wicked fernBOT
#

studio** You are now Level 1! **studio

earnest charm
earnest charm
wicked fernBOT
#

studio** You are now Level 1! **studio

earnest charm
#

when i put it in it just started going to random waypoints until it got stuck