- Home /
Navmesh Agent avoidance with as triggers
I'm getting ready to start working on the AI for my Pac-Man clone, but, before I get into pathfinding with NavMesh I had a question about agents as triggers. I know the agents would normally try to avoid colliding with one another while also moving towards their destination, so does setting them as triggers have this same effect, or would they walk through each other without any issue? I'm planning on having them walk through each other just like in the original game, but I wasn't sure if pathfinding would have them find alternate routes due to another ghost being on that path.
Answer by unidad2pete · Aug 14, 2017 at 05:55 PM
You have a lot of ways to do it, Check out the manual of component:
https://docs.unity3d.com/Manual/class-NavMeshAgent.html
You can modify the size of agent radius , making the agents are more near each others to get a collision, or you can set Quality property to None:
Quality Obstacle avoidance quality. If you have high number of agents you can save CPU time by reducing the obstacle avoidance quality. Setting avoidance to none, will only resolve collision, but will not try to actively avoid other agents and obstacles.
Or you can directly set radius of agents to 0 (or 0.001 if 0 its not permissive), agents only walks on navigation zone, you can make the way with standard boxes, scaling and making the way, when finish, bake the navigation area and you dont need NavMeshObstacles.
Awesome, thanks. I'll give these a shot once I start working on the enemies.
Your answer
Follow this Question
Related Questions
Trouble with Navmesh Agent and Navmesh Obstacle 0 Answers
Is there a limit on how far a navmesh agent can go? 0 Answers
Getting a navmeshagent back on a navmesh. 1 Answer
Unity Pathfinding One Way 0 Answers
NavMeshAgent calculated path going in a straight line ignoring height in between start and end 1 Answer