Search Unity

Question Is is possible to make navmesh obstacles conditional?

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

  1. ScottySR

    ScottySR

    Joined:
    Sep 29, 2018
    Posts:
    48
    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?