About the problem:
I have got a Player that has two scripts attached(PlayerController
and Entity
), a RigidBody
(isKinematic checked, no gravity), NavMeshAgent
and SphereCollider
.
Then I have got two exactly the same Enemies that have two scripts attached as well(EnemyAI
,Entity
), a RigidBody
(same),NavMeshAgent
and SphereCollider
.
Now the problem is that, I can go through them and they can go through each other as well. And this is something I definitely want to get rid of. To Move both enemy and player I simply use agent.destination. I put them also on different layers consequently "enemy" and "player" and marked to detect collision between them. Unfortunately that didn't appear to help.
And here goes my question. How to solve that? Thanks for your time and suggestions, hopefully they will lead me to the solution.