Stop player moving when attacking?

maybe someone can help me what I want is the player to stop moving when left/right + attack is pressed until the attack animation has ended.

my events:


The movement section of your event sheet would be way more relevant for this than the attack section.

You should add an inverted condition that checks for the attack animation.

In the same event with the input check for the movement key, add another condition "The animation of player is “attack” but flip the “invert condition” switch. That way it should return false when the player animation is “attack”, preventing the movement action from taking place.

1 Like

What i do is set a scene variable or player variable is_attacking, when the attack button is pressed set is_attacking to 1
then in the events to control the player movement first check if is_attacking = 0 then player can move
Hope this helps

1 Like

Thanks that worked! added a condition var “hit” is set to 0 simulate left/right and a var “hit” set to 1 when attacking then set var “hit” 0 after attack animation is finished.