Looping 2D Animation?
Hi,
I was wondering if there was a way to have a sprite appear and play a startup animation then loop an idle animation. In my case frames 1-5 is the startup animation and then frame 6-7 is my idle animation.
What I am trying to do is I have a script that swaps a sprite as you approach it and I would like when you reach the trigger radius the other sprite loads in with its startup animation and then loops its idle animation for the remainder of the time.
I'm using the script that Travis provided here: https://lensstudio.zendesk.com/hc/en-us/community/posts/360000375543-Trying-to-do-Marco-Polo-with-approach-but-baby-keeps-crying- for the sprite swapping but I can't get the animation looping part. Thank you in advance for any help.
Hi there! To make an animation loop by default, select the animation in the Resources panel. And then, in the Inspector panel, check the Always Play checkbox. See below:
Alternatively, if you are scripting the animation playback. Passing -1 to the play function will loop the animation. Here's a script that takes in a sprite and plays its animation looping.