Search Unity

How to get nav mesh to go inside this tower

Discussion in 'Navigation' started by Shadowing, Dec 22, 2019.

  1. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I used to have a nav mesh hitting the inside of this tower but no longer. Not sure what I did to get it to do it.
    Anyone have any ideas?

     
  2. Ne0mega

    Ne0mega

    Joined:
    Feb 18, 2018
    Posts:
    755
    the roof just barely has one, and the floor has noen. The roof is bigger than the floor by about the size of its tiny navmesh.

    Therefore your agent radius on your navmesh is probably too big to fit on the floor in the tower.

    Of course, how your agent gets to the tower is a whole nother story eh?
     
  3. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568

    When you bake your NavMesh, add the Inside of the tower as a child of the terrain, but not the rest of the tower.
     
  4. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    The agent just stays in the tower. Thinking about just disabling it for static agents.
    The tower is single mesh
     
  5. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    but if its hollow, you can add a quad or a thin cube in there and add mesh to it.
     
  6. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Oh ya good point lol. Why does it have to be a child of terrain?
     
  7. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    that way it gets a mesh as you bake your terrain, and it also gives it a radius based on your unit size so you dont get stuck on the edges of the walls etc, also so u dont fall off the tower lol
     
  8. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I'm confused :(
    If I add a rock on the terrain that isnt a child of the terrain and hit bake navigation mesh. It includes the rock in the navigation.
    I don't understand why the floor I make for the tower would be any different?

    For my understanding long as it has a collider it will be included.
     
  9. Mortalanimal

    Mortalanimal

    Joined:
    Jun 7, 2014
    Posts:
    568
    when you bake, did you have the terrain selected?
     
  10. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Didn't think that even matters lol. I know Unity by default adds the Navigation component next to the inspector window.
    I don't think the Navigation window has anything to do with game Object selection in the Hierarchy