[SOLVED] Timer reset when I change animation

I’m struggling with my timers…
I made that when the player shoot, he need to unpress the key and repress it to shoot again.
It works fine and all, until I press Left And Right together + the shoot key (d)
The timer reset because of the animation changing…
I know it may come from the fact I specified the animation + “press d” But I can’t figure it out myself how I can solve the problem…
I tried adding multiple timers but when I do so, the player won’t shoot anymore…
Any help ? :slight_smile:

Hey, I can think of a slightly different approach utilizing boolean variables.

I’ll use 2 booleans, “Cooldown” and “ShotFired”. The events would be something like this:

Event 1:
- Button is pressed         → - Shoot the thing
- Cooldown = FALSE            - ShotFired = TRUE
- ShotFired = FALSE
- Global vars check
- Animations check

Event 2:
- ShotFired = TRUE          → - ShotFired = FALSE
- (INV) "d" pressed           - Cooldown = TRUE
- (INV) "f" pressed           - Start timer
- (INV) "SQUARE" pressed
- (INV) "R1" pressed

Event 3:
- timer > 0.1               → - Delete timer
                              - Cooldown = FALSE

Hi, could you make the event on the editor and show me plz ? ^^

Nevermind ! Works really well ! Thanks a lot ! :smiley:

1 Like