Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Exclude terrain from nav mesh bake

Discussion in 'Navigation' started by dhenion65, Jan 3, 2020.

  1. dhenion65

    dhenion65

    Joined:
    Dec 17, 2019
    Posts:
    21
    I have a terrain in my scene that I've used to place tree and was also using it for the nav mesh. But I want to create a separate piece of geometry to use instead for the nav mesh.
    I go in to Navigation, clear the bake - select my new geometry and hit bake. It uses the new geometry but ALSO is still using the terrain object.
    How to I exclude the terrain object so I can only use the new geometry for the bake?
     
    Idealisers likes this.
  2. Idealisers

    Idealisers

    Joined:
    Jun 26, 2014
    Posts:
    10
    I just bumped into this one as well and found a solution.

    I'm using navmesh building components https://docs.unity3d.com/2020.1/Documentation/Manual/NavMesh-BuildingComponents.html

    What I did to resolve it is to create a layer called Terrain and add the terrain to this layer. After this you can add an empty game object with a navmeshsurface script and remove Terrain from include layers.

    Just add a plane to the empty game object as a child ( with the navmeshsurface script ) and press bake on the script component.

    No more terrain navmesh baking!
     
  3. fit2def

    fit2def

    Joined:
    Nov 7, 2016
    Posts:
    1
    Can't you just go into the Object tab of the Navigation window and uncheck the options associated to the Terrain?
     
  4. Robo_Gardener

    Robo_Gardener

    Joined:
    May 7, 2020
    Posts:
    1
    There doesn't seem to be anything associated with any specific Terrain, just all Terrains. Wouldn't help if one wanted to, for example, use a Terrain as a backdrop without a navmesh. I'm attempting right now to make the ones I don't want Walkable Non-Walkable.

    Update: This worked, there is no longer a NavMesh at all on the Terrains I marked as Non-Walkable. Nine square miles of NavMesh takes a while :)

    Edit: whoops, 9 sq miles was what WAS walkable; it was 72 sq miles I made unwalkable. No wonder... Just flabbergasted Unity handled either so well...
     
    Last edited: Sep 12, 2021