Pathfinding not doing good

Help

As you can see in the video the rig pauses before going to the next waypoint:

(forget about the music)

problem

heres the code:

local Rig = script.Parent

local PathfindingService = game:GetService("PathfindingService")

local path = PathfindingService:CreatePath()

local Points = game.Workspace:WaitForChild("points")

local TS = game:GetService("TweenService")

local TI = TweenInfo.new(1, Enum.EasingStyle.Back, Enum.EasingDirection.Out, 0, false, 0)

local point = Points:GetChildren()[math.random(1, #Points:GetChildren())]

path:ComputeAsync(Rig.HumanoidRootPart.Position, point.Position)

task.wait(10)

for _, waypoint in path:GetWaypoints() do

`Rig.Humanoid:MoveTo(waypoint.Position)`

`Rig.Humanoid.MoveToFinished:Wait()`

end

Rig.HumanoidRootPart.Position = point.Position

task.wait(2)

local Tween = TS:Create(Rig.HumanoidRootPart, TI, {Orientation = point.Orientation})

Tween:Play()

Posted Aug 4, 2026, 8:52 AM UTC

11
Loading comments…