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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

NavMesh with destructible/removable stairs

Discussion in 'Navigation' started by stephero, Mar 1, 2017.

  1. stephero

    stephero

    Joined:
    Feb 8, 2016
    Posts:
    123
    Hi guys,

    I have this simple situation: some stairs going from the floor to an upper platform.
    navmesh1.jpg

    I want to be able to remove/destroy the stairs, and of course to update my navmesh.

    I can deal with the stairs surface by having a NavMeshObstacle that I enable once the stairs are removed:
    navmesh2.jpg

    But the problem is that I don't have the floor surface which was under the stairs...

    Is there a way to handle this issue?
    Is there an entity (which would be kind of the opposite of a NavMeshObstacle) to add new surface to an existing NavMesh?

    Thanks
     
  2. CrymX

    CrymX

    Joined:
    Feb 16, 2015
    Posts:
    179
    Reduce the height and put a positive offset on the y axis of your navmeshobstacle so he don't collide with the ground
     
  3. CrymX

    CrymX

    Joined:
    Feb 16, 2015
    Posts:
    179
    maybe you shouldn't bake the stairs (so the ground is walkable) but add a NavMesh off link https://docs.unity3d.com/Manual/nav-CreateOffMeshLink.html ?
    Active the Navmeshobstacle and the off link when the stair is "visible" disable the off mesh link and the navmeshobstacle when your stairs is "invisible"