Help with variable change at end of animation

Hi everybody…

I am stuck with something that must be very simple, yet I cannot seem to get it right…

I have a game where when i press “Space” i change the animation of my sprite to one drawing a gun. This animation has 10 images with 0.03 sec between them.

What I need is to set a variable to change from default 0 to 1 at the end of the animation, so as not to be able to shoot or holster back the gun during the animation…

Any help will be greatly appreciated… Thank you in advance for your time…

:slight_smile:

I’m not sure I understand your doubt, but have you tried using the Sprite compare current frame? or when the variable x is 0 or 1 change the stop frame in the animation :slight_smile:

You have already explained how to do it:

[code]Conditions: Space key is pressed
Actions: Set Player animation to “drawing”
Do = 0 to variable “can_shoot”

Conditions: Current animation of Player is “drawing”
Animation of Player has finished
Actions: Do = 1 to variable “can_shoot”
Set Player animation to “idle”?[/code]

1 Like

Seriously, thank you both for the quick answer… I hadn’t seen the finished animation condition… It all works now…

I will post a link when I upload the first duel (it is a western showdown game, or at least that’s what i would like it to be…)