Im trying to learn pathfinding and i found this script and Im trying to break it down so I understand it
local pfs = game:GetService(“PathfindingService”)
local NPC = script.Parent
local part = workspace.Destination
local path = pfs:CreatePath({AgentCanJump = true})
path:ComputeAsync(NPC.HumanoidRootPart.Position,part.Position)
Can anyone Explain what this part about waypoints means?
for _, waypoint in pairs(path:GetWaypoints()) do
NPC.Humanoid:MoveTo(waypoint.Position)
NPC.Humanoid.MoveToFinished:Wait()
end