Animation problem

This forum is currently in read-only mode.
  • First of all, I'm a noob at construct but I understand concepts quickly. Secondly, I looked for my answer before this post and still could not figure it out. My question is... how do I set an animation to happen "on key pressed?" I have my "running," "jump," & "fall" animations working fine but my "throw" animation will only play the first frame (there are 3 total frames.)

    Here is what I put for my event, sub-event, & action:

    (event) On key Z pressed

    -- -(sub-event) player is on ground ----- (action) player: set animation to "throw"

    What else do I need to add?

  • Try adding "play animation".

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • i got the same problem, and what i did is to "reset" animation.

    • set animation" to "throw"
    • set animation frame to 1
    • play animation
    • i found exact same formula on the forum later on, so it must work
  • Try adding "play animation".

    I've tried that already and it does not seem to work. I have also tried "set animation frame" along with "play animation" and "set animation" in different variations and none of them seem to have any effect... only the first frame plays for some reason.

  • Could you post your .cap so someone can take a look?

  • i got the same problem, and what i did is to "reset" animation.

    - set animation" to "throw"

    - set animation frame to 1

    - play animation

    - i found exact same formula on the forum later on, so it must work

    I thought the same thing when it was messing up a lot but it only plays the first frame (its more of a twitch than a frame lol.) Even after slowing down the frame rate it is still only a twitch..

  • Could you post your .cap so someone can take a look?

    Sure, ill get it up as soon as I can. Just remember, its my first project and I barely started it so it sucks right now lol.

  • Ok I got it on rapidshare. "Z" is the button I want the throw on.

    http://rapidshare.com/files/174490900/Unnamed.cap.html

  • Fixed.

    You were telling Construct to set your running/standing animation without any regard for whether the throwing animation was playing. So it would start the throw, but then the very next tick it would set back to standing. You have to be careful about the order of your events, and make sure that you're not canceling your own events out accidentally.

    I added a "NOT Animation "kakashi throwing" is playing" condition, and made your running and standing events into sub-events under it.

    I also set your throwing animation to not loop, and added the "Set to frame 1" and "Play" actions to the On Key event. It works fine now.

    http://willhostforfood.com/files3/7264753/Unnamed.cap

  • i was just about to say that heh, deadeye's to fast

  • Fixed.

    You were telling Construct to set your running/standing animation without any regard for whether the throwing animation was playing. So it would start the throw, but then the very next tick it would set back to standing. You have to be careful about the order of your events, and make sure that you're not canceling your own events out accidentally.

    I added a "NOT Animation "kakashi throwing" is playing" condition, and made your running and standing events into sub-events under it.

    I also set your throwing animation to not loop, and added the "Set to frame 1" and "Play" actions to the On Key event. It works fine now.

    http://willhostforfood.com/files3/7264753/Unnamed.cap

    THANKS!! At least now I understand why it was twitching lol. By the way, your platform tutorial helped me out a lot. I'll be back with more problems in the future lol.

  • No problem... good luck with your game

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