Play just one time an animation when key is down

  • Hello all,

    I'm having a problem doing my platform game. When I pressed down key and play the animation of the character kneeling, it stuck in a loop. I mean I press down, he kneel, and then the animation start over again from standing to kneeling once and again until I release the down key.

    I set the properties of the kneel animation this way:

    Speed: 18

    Loop: No

    Repeat count: 1

    Repeat to: 6

    Ping-pong: No

    The event is on keyboard "Down arrow is down" and the action is that the object animations set to that kneeling animation.

    I'll share some picture but I don't know how to attach it from my local disk.

    Thanks for reading...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • For something like this you will have to share your CapX File.

    We can tell there is an issue but cant solve it from the lack of info in front of us.

    It seems like you have the settings correct for the animation itself but the error could be coming from your events.

    All i can say at this point is check your events one more time and or place your CapX.

    Hope this helps.

  • <img src="https://dl.dropboxusercontent.com/u/34375299/Construct%202/examples/triggeronce.PNG" border="0" />

  • "Down arrow is down".

    That's the problem. Use 'Down arrow is PRESSED'.

    'Is down' will keep firing as long as the key is down. 'Is pressed' will only fire once when the key is down. It's the same as going 'Is Down' + 'Trigger Once'.

  • Hey RookieDev, thanks for your suggestion about capx file. I'll take that in mind for the next time. Yes, you're right, the problem is on the events, thank you very much!

  • Shinkan, thank you very much for your answer it works!!!!!!!!!!!!!!!!!

  • Hello Dalal, thank you very much for your answer, I first test the anwser that Shinkan wrote and it works perfectly. But it's pretty good to know that the appropiate way to do it is as you wrote, it really makes sence!. Thanks!

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