platform 2d about collider

i am making a Mario like game as my first project. I put two 2Dcollider on the main player, one capsule as body and one Box as feet. I was planing like if enemies touch the body, the player dies, if the player steps on the enemy, the enemy gets killed. But when I use like “OnTriggerEnter2D”, “OnCollisionEnter2D”, the methods do not detect which collider touches the enemy, which means either I get invincible or I can’t hurt the enemy. How do I fix this problem? Thank you.

watch this video to learn how to make the stomping thing that you wanted to do. I think it has a different method for killing enemies than you Unity 2D Game Development 13 : Stomping on Enemies - YouTube

Have you added RigidBody to your character?
Sometimes this can be overlooked.

Hi @Youngken
I will recommend you to use simple Bool for each collision. If Player feet collides with enemy first, then mark Feet bool true and other one as false.

By doing this there will not be any conflict.

Thank You!