I’ve created a collection which has the followings game objects: interface and sparkles.
I’ve created a flip-book animation for each one of them, and it’s set to loop forward.
I’ve also attached a script to each game object, and it would tell them via msg post to play the animation in the init method.
function init(self)
msg.post("intro:/interface#glow","play_animation", {id=hash("anim")})
end
Now, the problem is sometimes it plays and sometimes it won’t. It doesn’t show any errors and I confirmed that the init function is called. What gives? I’m quite baffled.
Weird. Are you sure you don’t have several sprites on the same position and same Z so the animated sprite is covered? Z ordering is non deterministic. Playing animations should definitely not be.
So one of the sprites is a box (interface) and the animation is just a outer glow of that box. So, in my setup I put them in the same position. Should I alter the Z position as well ?