Y
Yoo
Guest
Hi, I have a somewhat simple question, but seems like a complicated task to do. I've created an animation (sprite) for my character when he is idle. I've attached it to an object. I've also created an animation (sprite) for a punch. I've added it to the object, however...
What to do so that, once I click a button on a keyboard... for instance space, an object/character does that action once? One click on the button, one loop of the animation/sprite. Because what I've managed to do is that only while holding a space bar down, the sprite changes from idle to the punching sprite, and once I've released it, it stops. Also, if I click very quickly on the space bar it doesn't give the full sprite animation, but only partial, as for long as I am holding the button. I want to just click the space bar once and sprite animation happens. One click, one animation.
How to do that?
EDIT: Basically what I did is I've added an animated idle sprite to the object, then I've added 'Key Press' for space and 'Change the sprite into...' my punch animation. Then I've added 'Key Release' for space and 'Change the sprite into...' idle animation.
What to do so that, once I click a button on a keyboard... for instance space, an object/character does that action once? One click on the button, one loop of the animation/sprite. Because what I've managed to do is that only while holding a space bar down, the sprite changes from idle to the punching sprite, and once I've released it, it stops. Also, if I click very quickly on the space bar it doesn't give the full sprite animation, but only partial, as for long as I am holding the button. I want to just click the space bar once and sprite animation happens. One click, one animation.
How to do that?
EDIT: Basically what I did is I've added an animated idle sprite to the object, then I've added 'Key Press' for space and 'Change the sprite into...' my punch animation. Then I've added 'Key Release' for space and 'Change the sprite into...' idle animation.
Last edited by a moderator: