PathfindingService returns NoPath

I am trying to use pathfinding to move my local player’s character to the top of a slide in my game. This involves climbing the slide. A path is only computed some of the way before the status starts returning NoPath. I have checked that the distance of my path is within the limits of PathfindingService (3000 studs).

I looked around the forum to see why this could be happening and found that in most cases, the navigation mesh is messed up. I looked into this, and it was a bit messed up on my build, so I placed some invisible parts to rectify the parts where it thought it was supposed to jump. Now, only on some points, the path still returns NoPath when computed. I’m not sure how the navigation mesh should actually look, so if it still looks wrong then that may be the issue.

This corner is the start of the issues. A path can be computed to this corner with no problems but on/after it, NoPath is returned.

Here is my code (using SimplePath module which is a wrapper around PathfindingService):

---> services
local replicatedStorage = game:GetService("ReplicatedStorage")
local players = game:GetService("Players")

---> modules
local simplePath = require(replicatedStorage.Packages.SimplePath)

---> variables
local player = players.LocalPlayer
local options = {
    AgentCanJump = true,
    AgentCanClimb = true,
    Costs = {
        SideBarrier = math.huge -- all parts on the sides of the path have this modifier
    },
}
local currentPath = simplePath.new(player.Character, options)

while true do
   -- compute a path to the current barrier
    currentPath:Run(workspace.programmed_holder.collection.barrier1)
end

Not sure if it’s the PathfindingModifiers on the sides causing this, or what the problem is. Would appreciate any help.

1 Like