wait(3) local torso = script.Parent.Torso.Position local endpoint = game.Workspace.WalkPointPart.Position local hum = script.Parent.Humanoid local path = game:GetService("PathfindingService"):FindPathAsync(torso,endpoint) local points = path:GetWaypoints() if path.Status == Enum.PathStatus.Success then for i,v in pairs(points) do hum:MoveTo(v.Position) hum.MoveToFinished:wait() if v.Action == Enum.PathWaypointAction.Jump then hum.Jump = true end end end print("goal reached")
I ran into a problem when using pathfinding. when the character gets to the part it wants to get to, it keeps trying to walk to it unless it walks in the center of the part. it finishes its goal if I turn the part cancollide false but I dont want this behavior. is there something I can do to cancel the pathfinding while its running?