Keep having issues with pathfinding that makes no sense!

ROBLOX’s pathfinding seems to keep failing calculating a pretty straightforward path from a certain distance, but if I bring the NPC above height it seems to find paths correctly…


Uploading: B.mp4…

These 2 gifs explain it pretty well using navmesh.
position = my character
root = npc

        local yHeight = Root.Position.Y
		local success, errorMessage = pcall(function()
			local newPos = Vector3.new(position.X, yHeight, position.Z)
			path:ComputeAsync(Root.CFrame.Position, newPos)
		end)
		if not success or path.Status ~= Enum.PathStatus.Success then
			--pathFind(roamPoints.Spawn.Position, roamPoints.Spawn)
			warn("Can't find a path")
			return
		end

image

The issue is not yHeight I also tried position.Y
Any suggestions?

Heh… Edit:

local path = PathfindingService:CreatePath({
	["AgentRadius"] = 0.05,
	["AgentHeight"] = 5,
	["AgentCanJump"] = true,
	["WaypointSpacing"] = 3,
	["Costs"] = {
		["Water"] = 50,
		SafeZone = math.huge,
	}
})

I had AgentRadius of 2 before and changed it to 0.05 and it works now!

Can I see the path find parameters please?
Edit : Nevermind

1 Like