I’m working on a project right now.
Here’s the thing since Unity 3.5 :
My enemies have a NavMeshAgent. My player doesn’t, he has a Character Motor, Character Controller and Platform Input Controller.
Collisions work perfectly from anywhere but the front of my enemies! If I run into their back, the player collides perfectly. But in the front, I just go through them!
Same thing when THEY run in my direction, they go through me and go to my exact position, causing teleportation and weird bugs.
I use SetDestination(player.transform.position) to make the enemy follow me.
I would be very greatful to any idea, I’ve tried everything! NavMeshAgents on both, Rigidbodies, colliders, etc…
Thank you very much,
Do your enemies also have a collider and a rigidbody attached to them? If not, that could be the problem. If attaching a rigidbody affects the movement of your navmeshagent, then make the rigidbody kinematic and that should remove its influence on navigator motion.
This helped with a similar problem I had when I started using Unity’s navigation system. Hope it helps you.
I found the answer here:
When I have the player walking and the enemy model static, they collide with each other as expected. When I make the enemy a Nav Mesh Agent, they stop colliding. If I use Ctrl+D to create multiple Nav Mesh Agent enemies , they collide with each...
Basically both the player and the enemy need a nav mesh agent attached so the agents are ‘aware’ of each other and don’t collide