1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. We’re giving 2017.1 beta testers a chance to win t-shirts and a Nintendo Switch. Read more on the blog.
    Dismiss Notice
  4. Unity 2017.1 beta is now available for download.
    Dismiss Notice
  5. Unity 5.6 is now released.
    Dismiss Notice
  6. Get further faster with the Unity Plus Accelerator Pack, free for new Unity Plus subscribers for a limited time. Click here for more details.
    Dismiss Notice
  7. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  8. Learn how you'll soon be able to publish your games to China in four simple steps with Xiaomi. Sign up now for early access.
    Dismiss Notice

Suggestion: Carve Specific NavMesh Surfaces with NavMesh Obstacles

Discussion in 'Navigation' started by Time_Flys, Mar 7, 2017.

  1. Time_Flys

    Time_Flys

    Joined:
    Feb 12, 2015
    Posts:
    6
    Hello, I recently downloaded the Unity 5.6 beta and have been messing with the NavMesh surfaces. They are amazing btw!

    One recommendation:

    It would be super useful if when placing 'NavMesh Obstacles' we could have them carve specific NavMesh Surfaces instead of all of them.

    Right now I want to create a NavMesh obstacle that one of my agents can go through, but the other agent can not.

    I tried messing with the 'IncludeLayers' on the NavMesh surface and disabling the layer the obstacle was on, but it doesn't seem to apply to NavMesh Obstacles, only objects that are stationary.

    Also, if there's already a way to do this. Then please let me know! I've looked around, but can't find anything. Something similar to the 'Nav Mesh Modifier' 'Affected Agents' for NavMesh Obstacles would be perfect!
     
    Last edited: Mar 7, 2017
    Tricktale and christougher like this.
  2. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    15
    This is something I would very much like to see implemented as well. I've got a specific case where I need the navmesh surface the player controlled agent is navigating, to not have a hole carved by a specific navmesh obstacle, but currently the obstacle carves a hole in all navmesh surfaces it intersects.

    I don't think there's a workaround for this either.
     
  3. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    198
    Ditto! I asked about this same thing not long ago!
     
  4. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    244
    There's no workaround for this one - it is noted.
    I'd like to know what is preventing you from using `NavMeshModifierVolume` instead of carving obstacles ?
     
  5. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    198
    Runtime carving. For editor baking the two NavMeshModifiers do the trick wonderfully, only setback is the lack of runtime usage.
     
  6. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    15
    As christougher says, I need this for runtime carving. I have an obstacle that moves off of the navmesh and then back on periodically, that requires pathing to be adjusted for everything apart from the player agent.
     
  7. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    244
    > For editor baking the two NavMeshModifiers do the trick wonderfully, only setback is the lack of runtime usage.

    They work for runtime baking as well. Is runtime baking not feasible for your case - and why ?
     
  8. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    198
    Well not that run time baking won't be feasible, they would work great for any baking scenario but I'm interested in carving with dynamic, moving obstacles that only affect certain agents. Can't be rebaking the nav mesh every time something moves, especially on mobile. NavMeshModifiers also don't affect LocalNavMeshBuilders that I can see either...
     
    Last edited: May 18, 2017
  9. Jakob_Unity

    Jakob_Unity

    Unity Technologies

    Joined:
    Dec 25, 2011
    Posts:
    244
    ok - so it's a performance problem i guess.
    The `LocalNavMeshBuilder` is supposed to be a simple example of the API, but it can be extended to support modifiers - e.g. similar to how it's done in NavMeshSurface.
     
  10. christougher

    christougher

    Joined:
    Mar 6, 2015
    Posts:
    198
    It's really more about getting the same runtime functionality we have from the navmesh obstacle, just expanded to include agent types.

    For my current games I have my nav meshes baked beforehand using NavMeshSurface. I have two agent types and I want certain moving obstacles to only affect one agent type. I'm targeting low end mobile (rhymes with kaizen *cough* *cough*) and higher.