Just one collision or "hit"

Hello! I’m trying to make my character hit enemies. I Created a rectangle which I use as a hitbox and when I attack I activate its physics so that it collides with the enemy, everything works almost fine only that when I press the attack key it collides more than once I don’t know why. What I did was activate the body of the rectangle only in a specific frame of the animation and deactivate it in the next frame, I thought that would be enough but no, several hits are still detected, please help me, I have been trying to solve this for days.

One animation frame usually lasts for several physics steps.

Disable the physics body after the first hit.

@samme How would you know when the first hit was?

Use the collision callback.