How to use a specific Box Collider 2D with OnTriggerEnter2D on a GameObject with multiple IsTrigger colliders?

I’ve got 5 Box Collider 2Ds on my Player GameObject, and I’m having issues with the Player taking damage from the colliders that are being used for attacking (which are further away from the player) and not from the player’s hitbox (which is just around their non-IsTrigger collider).

Basically I want to somehow tell OnTriggerEnter2D to use a specific collider, not just the one the enemy hits first. Is there any way to do this? Everything I’ve seen so far has assumed that there’s colliders on 2 different objects and suggest the use of tags, but that isn’t what I’m trying to do here.

Ok great thank you. I’m still a little unsure, but I think I understand a bit better. The 4 surrounding boxes will never trigger any collision with the player correct? If that’s the case, move them onto another layer, and then change the physics engine to ignore them.

So the player goes on its own “Player” layer, and the boxes get a “directional” layer. Then go to project settings, physics, layers and untick the collisions between “player” and “directional”. This will stop the boxes from triggering any collisions with the player, but you can still use them to trigger anything else (like enemies in the box when you attack for instance).

Assuming you have a Rigidbody on your character, every collider under a parent Rigidbody is a “Compound Collider” which means that they all detect collisions for that particular Rigidbody. If you want to check specific collisions than you should separate those triggers into a different object, with their own Rigidbody and logic.