- Home /
How to make the enemy avoid each other
I'm using NavMeshAgent for my AI and my question is: is there any way of making them as an obstacle for themselves? The reason of this is that when I have a large group of enemies they ignore themselves and so push each other in order to reach the player's position.
As the manual says(and I tried), I can't use NavMesh Obstacle component in a object with the NavMeshAgent, they don't work together since they will try to leave that space with no mesh, resulting in weird and super fast movements.
So how can we achieve that? Is it possible to cheat somehow these two componentes so they can work together like an agent ignoring its own navmesh obstacle component?
Answer by NdavN · May 10, 2017 at 01:14 PM
You cannot use them simultaneously, but you can enable one at a time!
Straight from the Unity Documentation: https://docs.unity3d.com/Manual/nav-MixingComponents.html
Your answer
Follow this Question
Related Questions
NavmeshAgent and NavmeshObstacle and Bake don't work with AICar 0 Answers
Unity NavMesh obstacle avoidance? 0 Answers
NavMeshAgent: How to set perception radius? 0 Answers
Instantiating a nav mesh obstacle makes all current nav mesh agents try to walk through a wall. 2 Answers
Unity Navagation Ground Mapping 1 Answer