Search Unity

  1. 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

Using Navmesh Obstacle on moving AI?

Discussion in 'Editor & General Support' started by LeftyTwoGuns, Aug 21, 2014.

  1. LeftyTwoGuns

    LeftyTwoGuns

    Joined:
    Jan 3, 2013
    Posts:
    144
    I'm having problems with AI running into each other and getting stuck. So I figured adding a Navmesh Obstacle to them would tell them to move around each other. But it causes them to slide all over the place a high velocity (actually kind of funny looking).

    I'm assuming this is because each AI is trying to avoid their own Navmesh Obstacle component? How do I get an AI to ignore that and only pay attention to other AI Obstacles?
     
  2. LeftyTwoGuns

    LeftyTwoGuns

    Joined:
    Jan 3, 2013
    Posts:
    144
    I've had minor success with adding a Navmesh Obstacle but disabling it in the inspector. Then in script only enabling it when the AI is attacking and disabling the Navmesh Agent. It works, sometimes. Other AI will successfully navigate around other AI that are attacking but the console fills up with errors, sometimes the AI stops working, and sometimes Unity crashes.

    I can't really find too much information on Navmesh Obstacle, either. Aside from other people saying it's broken. Is this just an incomplete function?
     
unityunity