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. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Question Is is possible to make navmesh obstacles conditional?

Discussion in 'Navigation' started by ScottySR, Jan 2, 2023.

  1. ScottySR


    Sep 29, 2018
    I need to make the navmesh agents (basically bots in this case) ignore an object in certain situations (depends on the agent's state). In one state it needs to be able to go around the obstacle to get behind it and in another state it needs to push it, so it has to ignore that it is an obstacle (otherwise it will not touch it to push it). I can't just turn off the navmesh obstacle component, because there are multiple agents that can be all in different states, so it has to be ignored per agent. The object they need to sometimes avoid, is the main object, so they need to be able to have an intelligent behavior around it. If you can't do that with a navmesh obstacle, is there any other way to do this?