[Solved] How to play two animations back to back after key release

Let’s say that I have 3 different animations, WalkingLeft (4 frames), IdleLeft (4 frames), and WalkingToIdleLeft (1 frame).

When I hold the left key, the WalkingLeft animation will play and move properly.

When I release the left key, it’s supposed to play WalkingToIdleLeft, followed by a looped IdleLeft. However, when I test my game, it just goes straight to IdleLeft.
How do I make it so that the WalkingToIdleLeft frame plays before the IdleLeft loop?

Thanks

1 Like

I’m not sure, but try to make it an sub-condition

1 Like

I may have misunderstood, but this is what I did to try and fix it (Unfortunately it doesnt work)
bug

Look at the screen in your question.

The first line of the animation remains (“left button is released”) unchanged, copy “idleLeft” instructions, create a sub-condition and copy it in the action, the condition remaining empty

But I’m not sure it works!

1 Like

For the sub-event of PlayKiril is WalkingToIdleLeft, there should be condition called “Check if animation has finished”, then once the walking to idle left animation is finished it should work.

1 Like

For the sub-event of PlayKiril is WalkingToIdleLeft, there should be condition called “Check if animation has finished”, then once the walking to idle left animation is finished it should work.

It doesnt seem to work! Does the WalkingToIdleLeft need to be looped to do this? It’s currently set to “Not looped”.

Not really, we want it to finish playing so it can switch to the other animation (but it shouldn’t matter).
Here’s where you can put that condition:


Otherwise if that does not solve, can you screenshot your current events?

1 Like

If your game is just a platformer, so you do not need the “IdleLeft” and “Walking left” sprite groups - you just need to use the “Flip Sprite Horizontal” event. Sample is a platformer in GDevelop

My character is not symmetrical and I need to make right and left sprites to reflect that, I would use flip in any other situation though.

here’s what i’ve been doing so far:
actions when buttons are pressed:


what occurs when buttons released:

change in speed / temporary respawn when out of border

i feel like the answer to my question is right in the event log but i cannot grasp at it.

You are missing trigger once. This means you are restarting your animation every frame, so it never truly finishes

2 Likes

At first this didnt work alone, but I solved the issue by redoing my controls. Here’s what happens when the left button is released:

Took me a while to figure it out but it was worth it, thanks for the tip

2 Likes