Search Unity

Navmesh and doors

Discussion in 'Navigation' started by undyingwill, Mar 10, 2017.

  1. undyingwill

    undyingwill

    Joined:
    Feb 3, 2016
    Posts:
    92
    Hello, i have really annoying problem with navigation mesh.. I have a whole level with floors, doors and everything. When i bake navigation, floors get blue, but the path from one room to another where the door is, remains not blue. I have tried to remove the doors before baking the navigation, but it is all the same... AI cant get from one room to another.
     

    Attached Files:

  2. Jakob_Unity

    Jakob_Unity

    Joined:
    Dec 25, 2011
    Posts:
    269
    The navmesh bake process includes only areas with enough horizontal and vertical clearance as walkable.

    please check:
    • Is the width of the door opening less than 2* "Agent Radius" in the bake settings?
    • Is the vertical distance from door threshold to lintel less than the "Agent Height" in the bake settings?

    - and adjust accordingly
     
  3. DeanMarquette

    DeanMarquette

    Joined:
    Feb 10, 2015
    Posts:
    165
    Huh? So how do you bake through a doorway?
     
  4. GreaserMonkey

    GreaserMonkey

    Joined:
    Feb 10, 2019
    Posts:
    65
    I had this exact same problem that when navmesh was baked the rooms could not connect. I found out that if the wall with the doorway was one object it would prevent navmesh connecting the rooms. The solution is to make a separate wall part for the upper part of the doorway wall and add a navmesh modifier component to it and then check the "Ignore from build" option and there you go!

    You can get the Unity navmesh components from https://github.com/Unity-Technologies/NavMeshComponents

    Have fun!

    upload_2020-3-17_20-37-54.png

    upload_2020-3-17_20-41-54.png
     
  5. PavelLangweil

    PavelLangweil

    Joined:
    Mar 4, 2014
    Posts:
    28
    @GreaserMonkey, I have a little different setup, but basically the navmesh does go through the doorway even when the room walls / doorway are a single object. I thought exactly the same thing like you, that I might need to separate it into multiple objects, but nope. I punched a hole by extruding / erasing faces.

    upload_2021-5-5_18-57-33.png
     
    GreaserMonkey likes this.