Characters Not Sliding Past Each Other

I am having a dilemma, I am making a 2-D fighting game with two players. I want the players to go past each other, but also get affected by the ground and walls. I was thinking about using layers to stop the collisions, but i need to check if player 1 hits player 2 or vice versa to do damage.

I figured out how to work around it. I ignored the collisions between the body collisions, but the other colliders, i did not do anything to ignore them, and it works.