Chaining sprite animations? (SOLVED)

Hi everyone.

I need the end of one animation gets started another. For example how can I make the “idle” animation aumatically run after playing the “attack” animation?

i play animation on the input function
msg.post("#sprite", “play_animation”, {id = hash(“attack”)})

tnx.

1 Like

You will get an animation_done message when a flipbook animation has finished. Or you can use sprite.play_flipbook() and the callback argument:

sprite.play_flipbook("#sprite", hash("attack"), function()
    sprite.play_flipbook("#sprite", hash("idle"))
end)
2 Likes

oh, thanks, it’s easy

2 Likes