NavMeshSurface is ignoring game objects when generating the mesh

I have some objects in my scene, they are just a sprite but with box collider 3D and a rigidbody.

I thought it would use the box colliders to work out the nav mesh surface but that doesn’t seem to be the case.

As a temporary fix I have just added a transparent cube where I want holes in the nav mesh, but it feels a bit hacky.

Is there a better way around this?

Thanks

Have you tried adding the NavMeshModifier component?

By default the NavMeshSurface is configured to use UseGeometry: Mesh Renderers. If you change this to “Physics Colliders” I think it will solve your problem.

1 Like

Ah excellent, thanks!