When key pressed and held not triggering once?

hello help I have problem when key is pressed and held down it keeps repeating the attack and I don’t know why? should trigger once and only again when pressed not held :sweat:


In event 1, the conditions are that x is pressed and attackcount = 0. In the actions, attackcount is set to 1. So the trigger once for the first event is no longer valid as the condition is false and is ‘reset’.

In event 2, attackcount is set to 0 once the attack animation is finished. And so the condition for event 1 are true again.

I think what you want is to have the x key pressed and trigger once conditions in a parent event, and the attackcount = 0 and the actions in a subevent.


EDIT I figured it out eventually also I worked out if I move the trigger once directly below key pressed condition it works but if it below attack=0 then will keep triggering when pressed down :sweat_smile:

trigger once working with combo attack events

Glad you solved but why do you set arrack=1 do you use that variable in other place?
The code should work even if you remove the subevent of attack=1 and move Create playerattack and set animation to the first events.

1 Like

thanks I didn’t need attack=1 sub condition at all and moved the actions to first event. the problem was the order I had trigger once in the condition :open_mouth: moved it up one line and it works.