Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

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:
    53
    Have you tried adding the NavMeshModifier component?
     
  3. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    265
    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!