How do I make my animation stop after press button once

From the Asset Store
Change the size and position of everything without calculating anything!
  • I make a variable to my playermask "normalattack" to false

    And then when A key is down set playermask "normalattack" to true

    When "normalattack" is true > play realplayersprite animation to Punch which is only have 1 frame

    The problem is as long as the A key is down it freeze the animation and when i release the key it goes back to idle

    How can i make the animation just play once after the A key is press and not freeze the animation if i hold the key down? Like street fighter game kinda thing. Can someone help ?

  • Try setting your animation to play from beginning and not to play frame 0.

    If that isn't what the issue is, please attach a CAPX and I'll look it over

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • An animation with 1 frame will trigger the 'stopped playing' in the same tick.

    Give it at least 1 frame more (i prefer 2).

    Now you have two options.

    1/ Set 'normalattack' to true on pressing 'A'. With an aditional 'trigger once while true'

    2/ When "normalattack" is true > play Punch .. from beginning (animation must not be looping) ...

    3/ Set 'normalattack' to false on Animation 'Punch' finished.

    4/ All other animation events get an additional 'when "normalattack" is false.

    Or, not using a boolean.

    1/ Set Punch to play when pressing 'A'. With an aditional 'trigger once while true'

    2/ All other events that start an animation get an additional condition 'when Punch is not playing' (inverted is playing).

  • this is my capx

    www(dot)dropbox(dot)com/home?preview=worrior+testing.capx

    this is the image of my event sheet unless you cannot open my capx

    www(dot)dropbox(dot)com/home?preview=testingworrior.jpg

  • Sure, give me login for your dropbox (you better not !)

    Or, share :

    https://www.google.be/search?q=dropbox+ ... hared+link

  • This the capx file

    www(dot)dropbox(dot)com/s/sxnzpfy6ybzqelg/testingworrior.jpg?dl=0

    This the img

    www(dot)dropbox(dot)com/s/9nqwggings058kx/worrior%20testing.capx?dl=0

    Sorry for the wrong link just now

  • Fixed ?

    https://www.dropbox.com/s/h4asvgiry5zt3 ... .capx?dl=0

    Although there is no 'punch' animation in it.

    Besides that.

    My heart cringes when i see how so many people mess up the animations by cropping the transparent edges in each frame.

    As a result each frame has a different size. And the relative position of the pixels of the graphic content towards the origin is dancing in each frame.

    As a result, a helper object, just to move the animated sprite, is mandatory, even in a simple project.

    I tried to fix the animation a little bit.

  • about cropping the transparent edges i just follow from tutuorial lot of em doing that , im still in learning how frame size and the origin point of each frame effect the animation, like on my attack animation u put the origin point on the worrior back leg on each frame it looks perfect now but on tutorial that i've learn they used to put the origin point in between the leg, tqsm it fix i cant believe it just that simple actually.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)