Hi guys,
I’ve created an explosion animation using an animated tile source.
The animation plays through once as expected but then the last frame just hangs there on the screen.
Is there a way to detect when a ‘Once Forward’ animation has completed so I can delete the explosion object?
Any advice would be much appreciated.
You need to change its animation to the default animation if you want to be able to get the message when it completes. Default animations on their own don’t send the complete message.
function init(self)
msg.post("#sprite", "play_animation", {id = hash("explode")})
end
function on_message(self, message_id, message, sender)
if message_id == hash("animation_done") then
...
end
end
3 Likes
Thank you, that’s great - worked first time!
1 Like