This seems like a bug, but perhaps it’s by design and I’m misunderstanding what the function is doing.
I’m using a Recast graph for my layout, and I have various “interaction nodes” placed around the world as potential destinations for my ai agents. When selecting an interaction node, I use PointOnNavmesh to determine if that node is within the navmesh (since it’s possible that a navmesh cut might have cut it out), and this was working perfectly fine.
I messed with the recast graph properties a bit, namely the tiling, and suddenly all of my agents no longer saw the interaction nodes as available; the PointOnNavmesh function was returning null for all of them. After scratching my head for hours, I tried moving them around a little bit, and all of a sudden they started working again. Looking at it closer, it seems like at the tile size I selected, it just so happened that all of them landed exactly on the edge between two tris in the navmesh.
Is this intended behaviour? Are edges between tris in the navmesh not considered to be “on the navmesh”?
For what its worth, there is no issue with finding paths to the point, it’s just the PointOnNavmesh call that fails.
I’m using version 4.3.75, in Unity 2023.1.0b12