No collision between enemy and player

Why doesn’t my player die when colliding with an enemy? Enemies have DamageDealer and also enemy colliders checked to act as a trigger. Collision matrix is set up right too. What am I missing?

1 Like

I have the same problem. And hope will be found the solution.

Hi, I have the same issue - my player takes no damage from the enemy when they collide. I too have DamageDealer components on the enemies with the matrix set up as in the video. Did anyone find out a solution for this?

Try to add Rigidbody2D to enemy/player and set it as Kinematic. This conponent will react to collisions as it said in Unity Documentation. Hope that helped. :grinning:

1 Like

Ahhh, that was it, thank you!

Stupidly enough, I had actually tried this but when I ran the game none of my enemies spawned so I assumed it didn’t work. Turns out they were spawning in my shredder collider so were spawning and then getting destroyed - d’oh! :stuck_out_tongue:

I did just that and checked the box “Is Trigger” for both the Player & Enemy, but they will not destroy themselves upon contact. My code is just like Rick’s and I just finished the Layer Collision Matrix lesson. The way I undestand it, the code we added to the Player & Enemy Scripts is designed to apply damage to everything when the Trigger happens, so I still don’t understand why it is not working when the ships collide.

Nevermind me, I was missing the DamageDealer.cs for both Player & Enemy Scripts.

Privacy & Terms