Feature request: ability to prune islanded navmesh regions

Often, when setting up a NavMesh for a level, there will be areas where a NavMesh is generated in a spot you don’t really want it to, and it is difficult to exclude with Modifiers or Modifier Volumes. For example: placing a large object such as rock or boulder on top of a walkable terrain. The inside of the rock or boulder might have a disconnected piece of navmesh inside of it. The modifiers don’t really work great in that case.

A simple solution could be for the level designer to specify a set of points on the NavMesh which are known to be accessible by the player, such as the player spawn point. Then, in a post-processing step on the baked NavMesh, any regions which cannot be pathed to from that point are deleted.

I had hoped I could implement this myself, but I do not think the navigation package has APIs that would make this possible.

1 Like

Here’s another example of a situation where the NavMesh could be automatically cleaned up by this feature.

We have been wanting this for a long time too. It would help a lot with level design, making it clearer to designers where the player or ai is actually able to go. But also with scripting. Where can enemies or other effects spawn? It could also slightly lower the ram usage due to the mesh being smaller.
I hope Unity considers adding this, it would help a lot

1 Like