Block NavMesh Generation in certain areas?

Is it possible to block navmesh generation at certain areas with Recast graph ( so its completly unwalkable and performance is saved), however not use components like NavmeshCut?

We have huge generated maps, however currently with mountains, the navmesh generates inside them. I know its not ideal, but right now we need to avoid this.

I tried using GraphUpdateObject and set it to every mountain tile, however it doesnt do anything (even when I tested its size to be like 50)

This is strictly for performance reasons.

Hi

If those tiles have box colliders, then they should automatically be excluded. Otherwise, you can attach the RecastMeshObj component to those objects and mark the surface as Unwalkable, and optionally you can also mark it as “solid”. However, for mesh colliders, you’ll need to have triangles on the bottom side of the object to make it work with solid.

But the maps could have tens of thousands of these mountain tiles (250x250 map)that’s the reason I cannot just use collides, it would drag performance down and I was looking for a way how to just mark it with a code and not create additional game objects with colliders.

How are these blocks represented right now?

Can you increase the Recast Graph → Character Height field to make the agent not be able to stand inside them?

These blocks are just mesh procedurally generated, issue is they have mesh even inside (on Y 0 plane as well) that’s why it’s detecting walkable areas inside.

So increasing climb height won’t help, as mesh is on same level as walkable area.

So there is no API to cut mesh via code only without using existing components?

Character height (might be called walkable height iirc), not max climb.

Still the same issue, even when I increase it significantly beyond the height of mountain (single cell of mountain block is 1x1x1 unity unit)

Is your graph bounding box very short on the y axis by any chance?

its 0.5 by default, so it doesnt calculate top of mountains where pathing is not possible anyway.
Now for test if I increase it to e.g. 10, and have walkable height also 10, the small navmesh cells disppear, but instead walkable grid is generated everywhere on top of mountains :slight_smile: which is even worse I think. Maybe we can somehow prevent this?

Hi

If you make sure to put the mountains mesh on a separate layer, in the next version you’ll be able to mark whole layers as having an unwalkable surface. Or, right now, you can add the RecastMeshObj component to the mountain mesh and mark its surface as unwalkable (I assume it is merged somehow already, for performance).