Also, you can download the sandBOX and use it for reference.
I do it this way:
- Place a invisible object behind the player and pin it, with the origin point on the bottom, then, rotate the object to the same side of the player, check if this object is overlapping the enemy and subtract 1 from his life.
- Every time you play fighting animations, create a invisible object behind the player, this object need to be larger than the player. Check if the object is overlapping the enemy, and, set to subtract his life.