Navmeshbase.Lincast gives false positive hits

Hi I am using a recast graph with version 4.3.46, and running into the issue that NavmeshBase.Linecast(vector 3, vector 3) incorrectly returns true if one or both of the two points happen to be on the edge of a triangle mesh node. I have seen this happen in cases where I am very confident that the involved nodes were directly next to each other, had a connection, and are on flat ground. Are there any workarounds for this?

I am trying to create an editor script which discretizes the recast navmesh into a 2d array of relatively equidistant points to be used as an influence map.

The plan is to still use the recast graph for efficient pathfinding, but for the AI to consult the influence map for visualizing the more dynamic aspects of the world and tactical decision making. Part of the process of creating the 2d grid does linecasts from the center of a cell in this grid to the edge of the cell, and if my Recast graph Tile size is a multiple of the cell size, I end up getting a ton of linecasts that have one point on the edge of the tile. These linecasts end up giving the false positives. I am using a recast graph because the game world is very big, and I am expecting to use World Streamer 2 to ring stream small parts of the influence map locally around the player as they move around the map.

I got the idea for this method of creating an influence map from this GDC talk:

He does some really interesting stuff in here, like precalculating line of sight from each node to surrounding nodes.

An example of their influence map grid is pictured at 6:48. Part of the process of creating the 2d grid requires both linecasts and pathfinding with a funnel modifier, and I’m finding that both seem to have some issues if you are on the edge of a tile/triangle mesh node


If you have a reproducible example of when the navmesh gives incorrect results, I would be very happy to see it :).