That was my solution too - move all the collision off the player parent object that contains the Rigidbody2D and do all the OnTriggerEnter2D processing a long way away from it in child objects and pass up the hits to the control object.
To solve the problem I had with my bigger-than-the-screen spawn/despawn triggers was to move those into a separate physics layer, and then add an extra child object and collider to anything that spawns so they would only interact with those triggers.
The net effect being that I’ve created more child objects on everything and added more colliders in the scene just to work around this erm… ‘feature’.
So, kathode…
Yep - since OnTriggerEnter2D is now less useful on your main player object (with the RigidBody2D on it) you might need to consider moving everything off the main player object into child objects.
First off - set up Physics Layers so that your Sword is in a different physics layer from the rest of your player body, and then perhaps organise like this:
Parent Player Object (has RigidBody2D on it)
|__ Child Player Body Object (has player body Collider on it and your PlayerControl script with the OnTriggerEnter2D in it)
|__ Child Sword Object (has sword Collider on it)
In that way you’ll know that your PlayerControl script’s OnTriggerEnter2D is only going to be affected by colliders that touch it and since the Sword is in a different Physics layer it should never interact with the body colliders.
If you need to add more systems, add them in as Child Objects to the Parent Player Object with their own scripts and you’ll at least know which colliders are being triggered.
The pain here, of course is that your control routines have to reference the parent’s transform to move it around.
The alternative set-up would be to keep your control routines on your Parent Player Object and then create a ‘Vulnerability’ script on your Child Player Body Object that looks for OnTriggerEnter2D events and then if a hit is taken, passes that info up to your control routines
I can see the benefits of the change, but without being able to discern which collider the OnTriggerEnter2D event is being triggered on we’re going to have to be more distributed in the way we process this sort of thing which means a more complex system, more scripts and more objects in the scene that have to be processed.
Good luck!