Search Unity

Can I make a NavMeshSurface ignore NavMeshObstacles while baking?

Discussion in 'Navigation' started by PencilManners, Jan 21, 2021.

  1. PencilManners

    PencilManners

    Joined:
    May 7, 2016
    Posts:
    14
    I'm trying to make a more dynamic level using lots of NavMeshObstacles and a NavMeshSurface to allow me to re-bake the NavMesh at runtime. However I've ran into a issue that I didn't have with the built in Navigation tab.

    When I was baking with the built in component, it didn't matter if there's an obstacle present with carve turned on. I could move the obstacle afterwards and the space it used to occupy would become walkable.

    But when I use NavMeshSurface, the space carved out by the obstacle remains. So for example, my AI can't move through doors or gates if they were opened after the latest bake.

    Is there a way to make the NavMeshSurface behave identically to it's original version without disabling and enabling every obstacle before and after a bake?
     
  2. adriant

    adriant

    Unity Technologies

    Joined:
    Nov 1, 2016
    Posts:
    69
    PencilManners likes this.
  3. ZoopTEK

    ZoopTEK

    Joined:
    Feb 14, 2012
    Posts:
    22
    Sorry for bumping an old thread, but I am getting desperate here.

    The NavMeshModifier, from what I have seen, is absolutely not reliable.

    I can set up a new test scene, bake navigation, add some obstacles with modifiers on them, clear the navigation data, rebake, and it will usually work.

    However, on a scene from the actual game, I follow the same steps, but this time through procedural generation, and it will never ever work. I have reviewed the steps, hierarchies, even the exact game objects used, and they all appear to be the same.

    There are other posts noting this. One person going as far as seeing that their nav mesh modifier is indeed being detected, but ignored anyway.

    I am praying you have heard of this issue before, lest I need to set up another lengthy post that will likely be ignored, and thus wasting me even more time.

    Can I just manually edit the nav mesh triangles, please? I have identified the offending ones, I just need to remove them, but instead of I am doing this absolutely mind-f-ing method generating an unwalkable trash mesh on top of nav mesh triangles I want to reject, then rebake, very similar to the NavMeshCleaner on the asset store, but at run-time.
     
    crandellbr likes this.
  4. gnovos

    gnovos

    Joined:
    Apr 29, 2020
    Posts:
    31
    The most current
    NavMeshModifier
    (I'm using 1.1.5) does not have "Ignore From Build" anymore. Is there a new way to accomplish this?

    Edit: Nevermind, it now has a "Remove Object" Mode which does seem to accomplish the same thing.