How to prevent navmesh from generating on top of the wall?

I have pretty think wall which I do not want the navmesh to be generated on top.

How do I go on about this? Don’t I have to include wall mesh / collider to the navmesh calculation layer in order to build navmesh for the ground? If so it generates navmesh on top of the wall if it is thick enough…

At first , I thought that if I limit the boundary of the navmesh calculation, it may skip the section on top of the wall, but alas, it doesn’t seem that way… if wall is included in the boundary, it doesn’t look like it matters how tall the wall is…

It is important because I generate units on top of the navmesh based on its existance, as well as other purposes… just checking for height isn’t enough.

Hi

Assuming you are using the recast graph, you can use the RecastMeshObj component and set the area field to -1. See http://arongranberg.com/astar/docs_dev/class_pathfinding_1_1_recast_mesh_obj.php#a5008f5aaa9ef50b1510e309dce9205d7

Another approach is to increase the Min Region Size in the Recast Graph settings to filter away small regions (assuming the walls are relatively small). You need to set it to relatively high values since it counts in voxels. 1000000 or higher is not uncommon.
It cannot be removed if it is on the border of a tile however since then it cannot know the actual size of the region while calculating it.

A third option is to use the RelevantGraphSurface component.
See http://arongranberg.com/astar/docs_dev/class_pathfinding_1_1_recast_graph.php#a6915c7a3bc45a0a4201e8d4919eda9f1

1 Like

I had bit of trouble using both collider and mesh and RecastMeshObj at the same time because sometimes one overrides another , but I have eventually made all my assets to just use RecastMeshObj and now it seems to work. More steps in my work flow but it will do! cheers!

Hi

Hm, the RecastMeshObj should override everything else, is that not what happened?
In that case it might be a bug.

I had a game object with mesh collider and RecastMeshObj script on it with -1 for area setting. Sometimes it generates navmesh and sometimes not. I have also tried to separate game object which has mesh collider and the game object which has RecastMeshObj into two different game objects but the results were to same. Sometimes it works and sometimes it doesn’t. Both objects were sharing the same mesh (collider and RecastMeshObj )

So I landed up unchecking “use collider” for scanning and just used RecastMeshObj only at the end.

Hm… Would it be possible for you to send me a small example scene which showed the bug (because that definitely looks like a bug)?