Play just one time an animation when key is down

Get help using Construct 2

Post » Wed Jul 17, 2013 6:08 am

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...
B
21
S
3
G
2
Posts: 86
Reputation: 2,262

Post » Wed Jul 17, 2013 6:13 am

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.
GMO FOOD = DEATH
B
23
S
9
G
5
Posts: 567
Reputation: 6,368

Post » Wed Jul 17, 2013 12:47 pm

ImageImageImageImage
B
156
S
64
G
41
Posts: 2,589
Reputation: 34,603

Post » Wed Jul 17, 2013 3:33 pm

"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'.
Image
B
10
S
3
G
2
Posts: 196
Reputation: 2,053

Post » Thu Jul 18, 2013 4:16 am

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!
B
21
S
3
G
2
Posts: 86
Reputation: 2,262

Post » Thu Jul 18, 2013 4:24 am

Shinkan, thank you very much for your answer it works!!!!!!!!!!!!!!!!!alejovilla2272013-07-18 05:08:47
B
21
S
3
G
2
Posts: 86
Reputation: 2,262

Post » Thu Jul 18, 2013 5:12 am

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!
B
21
S
3
G
2
Posts: 86
Reputation: 2,262


Return to How do I....?

Who is online

Users browsing this forum: LikeAlex2010, plinkie and 1 guest