Search Unity

NavMesh bake producing strange unwalkable areas around trees

Discussion in 'Navigation' started by hudmond, Dec 7, 2019.

  1. hudmond

    hudmond

    Joined:
    Jun 24, 2019
    Posts:
    5
    I made some trees using Mtree, saved it to a prefab, added to my terrain trees and painted them on the terrain in my project (and recreated in a fresh project). I then baked the NavMesh and I get this:


    I am getting these random crosses under my trees. They are making my forests impossible to navigate. The issue only exists when I paint the trees using the terrain editor, if I drop a tree in manually it works fine but all my painted trees produce this. If anyone knows what's going on here or how to prevent it I would really appreciate your input.
     
  2. Olmi

    Olmi

    Joined:
    Nov 29, 2012
    Posts:
    1,553
    Well. Looks like the raycast or whatever it uses to detect the obstacles is hitting your trees billboard foliage.
    Im not really that much into the nuances of terrain, but does it somehow change the collider type in those objects when you paint them?
     
  3. amaclaren

    amaclaren

    Joined:
    Sep 24, 2019
    Posts:
    1
    I'm hitting the same issue. did you end up resolving this?
     
  4. Swearsoft

    Swearsoft

    Joined:
    Mar 19, 2009
    Posts:
    1,632
  5. ZenniverseCreate

    ZenniverseCreate

    Joined:
    Sep 5, 2021
    Posts:
    3
    I had the same problem and this was the only page I could find describing it. The solution I found was actually super simple. When creating a tree, there's a field that reads "NavMesh LOD Index." By default, it goes to last. My issue was that my last LOD layer was the cross-shaped billboard. After setting the Index to first, it fixed this annoying issue. :)
     
    Claytonious likes this.
  6. Raziid

    Raziid

    Joined:
    Jun 13, 2017
    Posts:
    8
    This worked for me, thanks! Just to clarify that post, you pick the LOD index when adding the tree in the terrain settings, not when creating the tree mesh itself.
     
  7. EvanC4

    EvanC4

    Joined:
    Jan 24, 2013
    Posts:
    1
    Thanks for the fix. That worked for me. I set the NavMesh LOD Index to First instead of Last which had the billboards.
    TreeNavmeshFix.png
     
    Hotstuffnewton likes this.