Sprite weapon collision?

I don’t know if this belongs in Graphics, but seeing as my question is specifically related to 2D sprites, I put it here.

Anyway, I’d like to know how I would implement collision detection for a 2D sprite. More specifically, for the sprite’s weapon.

In 3D games, it’s easy, cause you just have to make the weapon object a child of the player character, and connect it with the arm/hand bone. But in 2D sprites, the weapon and player character are the same thing, and I don’t know how I would make them separately and then combine then.

Could someone please help me? I just need this for testing enemy hitting.

EDIT: What I specifically need, is to be able to make the weapon as a part of the same sprites as the attacking animation, but I want to do stuff like take enemy health away, and make them play damaged animations, only when either the sword part of the sprites touches them, or if I collide with them while the attack animation is playing.

The problem with the second method, is that the player will be able to damage enemies, even if he’s facing away from them. So how would I do it using the first method? How would I add a collider to a specific part of the sprite, and make it rotate and move around, as the weapon in the sprites moves?

I’m not a code guy - but here is a thought that might help with the solution you said won’t work.
Can’t the damage only happen (if) the player is facing the enemy?