This is for a 2D game.
I have a character with a sub-GameObject called hitbox. The component is deactivated by default. It gets activated in certain keyframe of the animation attack, and deactivated in the following keyframe.
When the hitbox is activated, if in touch with the foe’s hurtbox, it lowers the foe’s health by 1 point.
The problem I have is that between the keyframe that activates the hitbox and the one that deactivates it, several game frames are executed, so it ends up losing more than 1 health point.
How could I address this issue?