Search Unity

Resolved NavMeshSurface is ignoring game objects when generating the mesh

Discussion in 'Navigation' started by RealMcCoyGames, Aug 1, 2021.

  1. RealMcCoyGames

    RealMcCoyGames

    Joined:
    Jul 23, 2018
    Posts:
    65
    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
     
  2. batvink

    batvink

    Joined:
    Sep 26, 2019
    Posts:
    61
    Have you tried adding the NavMeshModifier component?
     
  3. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    268
    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.
     
    RealMcCoyGames likes this.
  4. RealMcCoyGames

    RealMcCoyGames

    Joined:
    Jul 23, 2018
    Posts:
    65
    Ah excellent, thanks!