Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Can NavMeshObstacles modify an area instead of removing the path altogether?

Discussion in 'Navigation' started by FeastSC2, Nov 10, 2019.

  1. FeastSC2


    Sep 30, 2016
    I have some enemies that want to avoid the light and some others that can go in the light.

    In order to do this, I want to create/modify the areas of the navmesh at runtime on the spots where the lights are. My lights are spherical just like a sphere collider so using NavMeshObstacle I modify those areas>
    HOWEVER these these areas are completely removed from the navmesh instead of having their layer modified like I would like.

    Is there a way to modify layers of the navmesh at runtime based on a collider that moves on the navmesh?
    Last edited: Nov 10, 2019
  2. DwinTeimlon


    Feb 25, 2016
    Yes, you can have use Navmeshmodifier Volumes and change their layer settings. Depending on the size of your Navmesh and on the frequency of layer changes, you might run into performance issues. Afaik the navmesh baking is using DOTs already, so it's expected to be really fast.
    Last edited: Nov 11, 2019
    FeastSC2 likes this.