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

Excluding grass from navmesh

Discussion in 'Navigation' started by SUUNE, Feb 23, 2021.

  1. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    65
    Hello.
    I have a problem with baking navmesh on terrain. I have all grass on the terrain as trees because HDRP terrain don't support grass (if is do - its too late now from me to change it - or rather I would prefer not to make all the grass from scratch) and now I try to bake navmesh on the terrain and looks like navmesh marks all the grass as non walkable area... I tried to tick and untick grass prefabs as navigation static but its not making any difference.

    Any ideas how I should make it right?
     
  2. SUUNE

    SUUNE

    Joined:
    Mar 10, 2019
    Posts:
    65
    bump :(
     
  3. blackfritz

    blackfritz

    Joined:
    Sep 13, 2018
    Posts:
    9
  4. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,624
    If you have trees or grass planted as trees, and navmesh wont bake correctly, theres a workaround ive used.

    Go to terrain tools, select your trees or grass (with a very large brush size), and delete them. Now bake navmesh, once done, undo/undelete them. (navmesh bake cant be undone, so uneffected)...
     
    JBR-games likes this.
  5. androvisuals_unity

    androvisuals_unity

    Joined:
    Mar 23, 2020
    Posts:
    46
    I think the easiest way to do this is to just have a physics layer set to objects you do not want to bake, then when you bake just do it from the layers.

    I use the navmesh surface component for this. Heres an example of some settings I use.
    upload_2023-1-8_20-42-30.png

    upload_2023-1-8_20-42-56.png
     
  6. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,624
    But if you placed your grass as trees (terrain tools), that wont work, but it will work for anything manually placed. Also not everyone uses navmeshsurface, some use the builtin navmesh system.