PathFindingService Giving Closest Path To Object

A wonderful feature in the old pathfinding service that, unfortunately, is missing in the new one.

Previously, if you wanted a path between START and FINISH, but no path can be established (e.g because of a wall surrounding FINISH), the status of the path would be ‘Enun.PathStatus.ClosestNoPath’, and would return the closest path that it can find to FINISH, which doesn’t actually reach it. This was great for AI that chases the player because if the player is hidden somewhere or is in a spot that glitches the pathfinder (e.g in furniture or a bunch of small parts), then the robot would at least have a lead to work with, the closest path to the player. From there, it can try other methods of locating the player.

However, the new PathFindingService allows only 1 status for an unsuccessful path, ‘Enum.PathStatus.NoPath’, while returning an empty path object. No closest path. This makes it unbelievably frustrating to work an AI because of constant terrain glitches that result in no path and with no lead for the AI to take.

In short, I think that the old “ClosestNoPath” status should be returned with its associating function that gives you the closest path to FINISH, even if a normal one is impossible.


Can’t believe this one doesn’t have more traffic!
Not being able to build partial paths is very limiting.
Example: Make NPC wander around a radius

  1. pick random point
  2. pathfind to the closest point reachable from that point
  3. walk n distance on this path
1 Like

Instead of PathStatus, I think it should be included in the AgentParameters table passed to CreatePath.

ClosestNoPath was a PathStatus, it wasn’t a parameter from what I can tell. You aren’t telling Roblox to find the nearest path to the goal, Roblox is telling you it can’t find a path but will give one that gets you as close as possible to the goal.

This feature would be pretty cool if it isn’t already a thing, for purposes like the example given in the main post.

1 Like

Computing another path may not be that performant, so i suggested a parameter that would tell roblox to try to find the closest path(maybe use the same PathStatus even)