Sunday, November 18, 2018

unity - Enemies are penetrating in each other when following player


enter image description here


As you can see the image my enemy (when following my player), penetrate each other. How can i avoid it? I am using NevMeshagent to follow the player.


void Update () {
currentNavMeshAgent.destination = player.transform.position;
}


I have added a Rigidbody and a Collider to my enemy object but they are still penetrating each other



Answer



To avoid penetration, increase each NavMeshAgent's radius so it's equal to or larger than your agent's collider.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...