Search Unity

  1. Unity 2020.2 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

NavMesh Modifiers are completely ignored

Discussion in 'Navigation' started by Wrymnn, May 11, 2019.

  1. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    307
    NavMesh Modifer and NavMesh Modifier Volume components are doing exactly nothing.
    I have read entire docs on them, and they should work, but they don`t.

    This is NavMesh Modifier Volume:

    - modifier area set to Non-Walkable
    - clicking Bake generates nav-mesh, but ignores both Modifier
    - NavMesh Modifer with mesh does not work as well

    upload_2019-5-11_14-30-36.png
    upload_2019-5-11_14-31-25.png

    Any ideas what is happening?

    Yes here it seems everything is working just fine:

    upload_2019-5-11_14-35-14.png
     
  2. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    437
    Stupid suggestion, but are the objects with the modifier volumes set to navigation static?
     
  3. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    307
    Do you mean GameObject’s “static” property? Or some other component/setting in Navigation?
     
  4. Wrymnn

    Wrymnn

    Joined:
    Sep 24, 2014
    Posts:
    307
    Okay got it, it has to be marked as Navigation Static.
    How would you go about changing areas in runtime? Is it necessarily to bake the entire mesh again? Since small nav mesh obstacles can carve holes in runtime without huge performance costs... it should be same with carving new areas, right?
     
  5. Yandalf

    Yandalf

    Joined:
    Feb 11, 2014
    Posts:
    437
    I'm honestly not quite sure, but the obstacles are possibly using different means to carve themselves out.
    You might indeed have to rebake, but if I remember correctly the NavMeshBuilder does keep track of the changed parts and only rebuilds those, so it is more performant than one might initially fear.
    If it turns out the areas change in realtime without any further work, then they might just automatically trigger a rebuild when changed this way and you shouldn't worry about things.
     
  6. ahxel

    ahxel

    Joined:
    Aug 4, 2018
    Posts:
    1
    encountered this same problem. here's how I was able to resolve it in Unity 2019.3
    1. Create a NavMesh Surface (GameObject > AI > NavMesh Surface)
    2. In the Hierarchy, transfer existing GameObjects with a NavMeshModifierVolume component to the NavMesh Surface created in step 1 (i.e. make them child objects of the NavMesh Surface from step 1)
    3. Bake the navmesh again. (note: I did this from the Inspector window, not the Navigation window. In the Hierarchy, select the NavMesh Surface created from Step 1 and there should be a Bake button in the Inspector window)
    4. Delete the old navmesh surface by going to the folder of your current scene and deleting the old NavMesh file (the new navmesh has a suffix '-NavMesh Surface', the old one doesn't)
     
unityunity