Humanoid Not Following Pathfinding Services Waypoints

So i tried to use pathfinding service to make a rig get to the end position just for fun and for some reason its skipping all the waypoints and going straight to the end

Video:

After this it looks like the only way to fix this was to add a wait function since the MoveTo() function was updating so fast it made it seem like it just skipped to the end

local PathFindingService = game:GetService("PathfindingService")

local Rig = workspace.Rigs.AnimationRig

local Humanoid = Rig.Humanoid
local Torso = Rig.UpperTorso

local Path = PathFindingService:CreatePath()
Path:ComputeAsync(Torso.Position, game.Workspace.EndPart.Position)
local Waypoints = Path:GetWaypoints()

for i, waypoint in pairs(Waypoints) do
	
	local Part = Instance.new("Part")
	Part.Anchored = true
	Part.Material = "Neon"
	Part.Parent = workspace
	Part.CanCollide = false
	Part.Position = waypoint.Position
	Part.Size = Vector3.new(1,1,1)
	Part.Shape = Enum.PartType.Ball
	
	Humanoid:MoveTo(waypoint.Position)
end

is there any fix except adding a wait function?

why is ur Humanoid:MoveTo(waypoint.Position)'s waypoint isnt in capital?
i mean its supposed to be Waypoints instead of waypoint

Its not because its in a i pair loop.

Never mind just found out about the event MoveToFinished

oh okay, im not experienced one sorry if i seems bothered u

1 Like

No problem man we all are here to learn

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.