Why is my NavigationAgent3D choosing indirect paths?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By zennehoy

I am working on a 3D tile based building game in Godot 4.0.3. Every filled tile position creates a navigation region that is simply a square. The navigation regions appear to be stitched correctly, and edges between tiles are correctly merged. However, the paths returned are sometimes quite strange:

The path leaves the current navigation region (square bottom) in the middle of the edge to the target navigation region (square top left), indicating that the edges are properly connected. However, the path then proceeds to the top left corner before returning to the actual target at the center of the target navigation region.

Any ideas as to what may be causing this?

:bust_in_silhouette: Reply From: smix8

Presumably your target position is very slightly behind the edge on the next polygon and due to float errors the corridorfunnel pathpostprocessing snaps to the polygon corner before it backtracks to the position in the middle of the edge.