-1

i am trying to add navmesh obstacle and navmesh agent component on the same GameObject. However, I am getting a strange behaviour (the object will keep change it position randomly).

SO, if we have two agents in a narrow corridor, although they block each other path as in the figure, both agents will still have a path. Both agents will run to each other and push each other because there is no space to execute RVO (an algorithm that unity use to avoid obstacles) and navmesh will not re-plan a new path. figure

can anyone help!

thank you in advance

MD

1 Answers1

0

Try to put the navmesh obstacle to a child of the navmesh agent

Bean5 Music
  • 179
  • 4
  • No, it doesn't work because the agent will try to avoid itself. There is a solution but it is expensive and i do not really want to use it which is baking navmesh at runtime with adding navmesh volumes to the agents. – Mohannad Aldakhil Jun 17 '20 at 09:45
  • I googled it and found out u don't need a navmash object, navmash agents can avoid each other by the radius setting. [Navmash avoidance](https://forum.unity.com/threads/navmeshagent-being-nav-mesh-obstacle-at-the-same-time.602128/) – Bean5 Music Jun 17 '20 at 10:56
  • Bro it will not solve the case i have please read the question and look at the figure attached – Mohannad Aldakhil Jun 18 '20 at 14:36