Play 2D Animation at the beginning of the lens
Hello!
I have 3 different animation files in my lens, I just want them to animate once when the lens is activated/launched, not even on tap.
How can I do this? I tried a couple of scripts and didn't work (I don't know much about scripting so I wasn't able to troubleshoot it).
I think it should be just one check mark same as Reverse, Ping Pong and Always Play, just need it to play ONCE.
Thanks!
Hi Luis!
You can use the Behavior script for this!
1. Add a Behavior from the Objects panel by going to Add New > Helper Scripts > Behavior.
2. On the Behavior object, set Trigger to "Lens Turned On", and Response Type to "Animate Image".
3. Under Target, set either your Image object or the texture asset you want to animate.
4. Set Action to "Play" and make sure Loop is turned off.
Just set this up for each texture you want to play and it should do exactly what you want. As a shortcut you can set it up once and then duplicate the object, just changing the target area of the duplicates to the other animations you want to play.
Let me know if you need any more help!
Jacob