Pathfinding help

im using this pathfinding module:

my problem is when a part is within 9 studs above the npc the pathfinding just straight up breaks, as shown in this video:

im not sure if this a known problem with pathfinding and is a easy fix or something unique.
thanks.

When creating a Path, you can edit the AgentHeight parameter to adjust the minimum vertical space (in studs) needed for the Agent to walk through. Try lowering it

even when tweaking those values it wont work its only when the roof is a good amount above it still


AgentParams = {
	AgentHeight = 5,
	AgentRadius = 3.25,
	AgentCanJump = false,
	AgentCanClimb = false
}

local path = game:GetService("PathfindingService"):CreatePath(AgentParams)

path:ComputeAsync(workspace.Killer.HumanoidRootPart.Position,workspace.endd.Position)

for i, wp in path:GetWaypoints() do
	local checkpoint = Instance.new("Part",workspace)
	checkpoint.Anchored = true
	checkpoint.Position = wp.Position
	checkpoint.Shape = Enum.PartType.Ball
	checkpoint.Material = Enum.Material.Neon
end

I don’t think there is any way to fix it. I play a game made by professional Roblox developers called Zombie Arena and if you stand in a certain spot the zombies just get stuck trying to move to you so yeah Roblox just needs to fix their entire pathfinding service because it’s broken

Try decreasing the agent height further, and move your waypoints down.
If that doesn’t work try enabling workspace.PathfindingUseImprovedSearch, which should improve pathfinding quality: Improving Pathfinding Quality With New Algorithm.

If it still doesn’t work, enable “Show Navigation Mesh” in Studio Settings, and see what it looks like.

still not working unfortunately, i can give you the place file if you want to go through it?

yeah ive tried alot of things its still creating a path 8 studs above the agent lol

Sure, I’ll go through it and see if I can find the issue.

1 Like

i made the ceiling 2 studs higher so the bug doesnt happen anymore but if u lower it the bug will happen. (the pathfinding script is located in ServerScriptService > KillerScript, and the module is in ReplicatedStorage > SimplePath)
pathfindingbug.rbxl (1.4 MB)

Try making the roof a bit thicker or increase the pathfinding cost of it.