Preventing Recast Graphs Nodes inside Obstacles

Hello everyone,

I’m guessing the answer is ‘no’, but is there any better way to make sure nodes are not created inside of other objects (aside from using the pre-established options)? You can see in my image, the dark red area (which represents a flat river) is fine, but all the other colors are actually areas inside of other geometry (hills / mountains in my case).

Other than using the already existing settings to minimize waste / make more custom meshes (in my case I’m using 1 plane mesh prefab as water for every scene) I don’t have any ideas.

Any ideas are appreciated, thank you for reading.

1 Like


That’s because when using meshes (which the recast graph does), there is usually not a clear definition of “inside”, meshes are usually not completely closed, so the recast graph only cares about the actual triangles in the meshes.
You can use a RelevantGraphSurface component to mark the regions that you want to be included in the graph, but then you will have to add one manually to each tile that you want to keep. You can also use a RecastMeshObj component to mark the surfaces of some objects not generate any navmesh, but only act as blockers.

Also you could try increasing the character height to a very high value so that the character would not fit inside the obstacles.