Pathfinding Help!

Salut! I am having a bit of trouble with my Pathfinding script Seen Below. It just simply does not want to move the npc to the Part in workspace that i need it too. I would use the Roblox Documentations for this type of stuff… But it is very vague in (in my personal opinion).

local human = game.workspace.Dummy
local torso = human:WaitForChild("UpperTorso")
local PathfindingService = game:GetService("PathfindingService")
local Endpart = game.workspace.Part

local path = PathfindingService:CreatePath({
	AgentRadius = 3,
	AgentHeight = 6,
	AgentCanJump = true,
	AgentCanClimb = true
})



path:ComputeAsync(torso.Position, Endpart.Position)
human:MoveTo(Endpart.Position)

I could just be not using the right functions, but once again the documentation on this stuff was scarce.

Another thing to note is that i do not get any errors in the output when ran.

1 Like

It’s not super easy to find, but this article will give you some assistance. Basically you’re creating a path, but you’re not calling the waypoints to use, and there’s quite a bit more to it like how the moveTo function times out after 8 seconds regardless if the character has moved to it’s point

1 Like

You need to have the Humanoid of your Human to walk towards the part. You also have to loop through the path waypoint to move your character so:

for I,v in pairs(path:getWaypoints()) do

human.Humanoid:MoveTo(v.Position)

end
1 Like

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