Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Custom NavMesh obstacle for terrain trees?

Discussion in 'Navigation' started by MushyAvocado, Jun 26, 2022.

  1. MushyAvocado

    MushyAvocado

    Joined:
    Oct 16, 2021
    Posts:
    20
    I have a terrain with trees on it that is baked into the NavMesh. The NavMesh automatically creates a barrier around the trees, but it seems to be based around the model, not the collider. Since I only want the AI to dodge the trunk of the tree, not the branches, how can I create a custom NavMesh obstacle for the trees? I tried adding a NavMesh obstacle to the tree, but it didn't do anything. Here's a screenshot showing what I mean:

    tree nav.png

    Basically, that's too big of a barrier, I want it to be smaller and be able to set a custom NavMesh obstacle on it.
     
    devbot_amata likes this.
  2. Inxentas

    Inxentas

    Joined:
    Jan 15, 2020
    Posts:
    277
    I am unsure on how to do this with Terrain Tools, but with PolyBrush you can "paint" actual Prefabs as if they were trees. This allows you to add custom NavMeshObstacles to these trees.