My pathfinding Ai gets stuck on nothing

My pathfinding Ai gets stuck for no reason. I suspect it has something to do with the PathParams.

local function getPath(destination)
local agentHeight = Ai.HumanoidRootPart.Size.Y + 0.05
local agentRadius = math.max(Ai.HumanoidRootPart.Size.X, Ai.HumanoidRootPart.Size.Z) / 2 + 0.2

local pathParams = {
[“AgentHeight”] = agentHeight,
[“AgentRadius”] = agentRadius,
[“AgentCanJump”] = true,
[“WaypointSpacing”] = 1.5
}
local path = PathfindingServices:CreatePath(pathParams)

path:ComputeAsync(Ai.HumanoidRootPart.Position, destination.Position)

return path
end

Here are some examples:

I think only showing pictures might not give us a clear idea on why it is stuck. Can you try to record a video of the issue happening? You can also try to create a function that visualizes the waypoints of a path so we can understand how Pathfinding service is computing the path.

Try searching other pathfinding posts. I’m pretty sure I read in one that if a waypoint takes longer than 8(?) seconds to reach the NPC will stop.

2 Likes

I’m pretty sure it would be documented by Roblox if this were true. Maybe it was left undocumented. There most likely is still a underlying cause for @VitaRedux0 ‘s problem

Try increasing your AgentHeight and AgentRadius

It is.

Humanoid | Documentation - Roblox Creator Hub

1 Like

Huh. I must’ve not read that before. Alright, thanks for the correction.