Expected behaviour:
Pathfinding should link waypoints that can actually be reached by each other
Actual behaviour:
Pathfinding generates an impossible path by placing a seemingly random waypoint far below the terrain region, and connecting it with a waypoint on the terrain itself.
As seen in the image above, pathfinding has linked waypoints that can’t be reached by simply walking, causing the NPC to become stuck in an endless loop of trying to reach a waypoint it can’t, moving around randomly in an attempt to get un-stuck.
Studio has the “Show Navigation Mesh” option turned on, the only other path indicator is the slightly transparent green square that indicates the waypoint the NPC is trying to get to, called “Goal” under workspace.
Place file:
npc smooth pathing.rbxl (57.5 KB)
Repro steps:
Unknown, but may be related to having a waypoint over some sort of terrain boundary? An issue with raycasting has been reported before: Raycast misses Terrain in a specific pattern - #7 by Etheroit
Even if the issue of the waypoint going through the terrain is due to raycasting, there’s still the issue of pathfinding not checking if there’s any obstruction between the two waypoints.
Impact: High
This can completely break NPCs on maps with terrain, as the waypoint becomes unreachable and the NPC gets stuck in an infinite loop.
Workaround:
Re-generate the path every once in a while, this is really only a failure state if the path is never re-calculated, but is a game-breaking issue nontheless.
First noticed: ~28th August, 2022
Last occurred: 13th September, 2022