Simple animation in tween.js
I'm having a little trouble coding an easy animation in tween.js. I want to have the object bounce between 4 or 5 positions infinitely. I have tried following this guide and was able to have the object bounce back and forth between two positions (by changing every reference to scale to position).
I can't seem to figure out how to add more positions to the script, as my coding abilities are limited. I hope you can help me out!
Hey Bram!
We actually created a more simple system using Tween.JS found here:
https://lensstudio.snapchat.com/guides/scripting/tweening/
It has a importable object you can add to your project and them some helpful scripts for tweening different things like Transform, Color, Alpha and Billboard. You should be able to use this to do what you want without writing any code because these scripts are tuned completely in the Inspector. Hope that helps!
And to have the object move between multiple positions you can either use the delay parameter in the tween or chain them together via callback. For the callback approach, check out the scripting tween section in the guide linked above! There's an example that comes with the importable Tween system which shows how multiple tweens are chained together.
Thanks a bunch Travis! Those two combined will definitely help and the creation of the simpeler Tween system is awesome!