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. Dismiss Notice

Question Can I use intersecting NavMeshVolumes to navigate through Not Walkable volumes?

Discussion in 'Navigation' started by Venwin, Apr 1, 2023.

  1. Venwin


    Mar 17, 2023

    I am using Unity 2021 so I am pulling from the github for these "advanced" NavMesh tools.

    I'm trying to make a prefab for a building that normally should behave as an obstacle for NPCs to walk around. However, I want it so that when I tell an agent to go to the building, that they understand how to properly enter the building through a pathway. So right now, I have two NavMeshModifierVolumes created, one is attached to an empty object that is the parent of everything else in the prefab. This volume is defined as not walkable. Then I create a child empty object that also has another volume that is walkable. Right now, the whole object can be walked through by an agent. I'm not really sure what to do, I tried making the parent empty object an obstacle and that didn't work, and I tried making the child walkable volume also have a NavMeshModifier set to walkable and that didn't do any noticeable changes. The prefab is set on a custom layer I made, but I don't think that matters since a NavObstacle can carve normally if I try to make one. The prefab is not set to static.

    Am I using the right tools for the job even? I am a Unity newbie so I could be overcomplicating this problem. What am I missing? At the end of the day I just need a Nav Agent to recognize that the prefab building is considered a wall unless the agent needs to go inside, and then to know how to go inside. Any insight/help is much appreciated.

    forumImg1.png forumImg2.png