monema Posted December 7, 2020 Share Posted December 7, 2020 Hi to every one, can i use a complex timeline as a bundle of sub animations. For ex. i got A to B to C to D now i got an event and i need just to play B to C or C to B. There's a way to achieve that, by...i don't now tagging or labeling around? Thanks Link to comment Share on other sites More sharing options...
Carl Posted December 7, 2020 Share Posted December 7, 2020 Hi, this is a perfect use case for tweenTo() or tweenFromTo() Video below should help Docs for tweenFromTo() 5 Link to comment Share on other sites More sharing options...
ZachSaucier Posted December 7, 2020 Share Posted December 7, 2020 If you're just doing this for debugging, GSDevTools can likely do all that you need (and more). In addition to what Carl suggested above, you could try using function calls with some logic paired with a .pause(): See the Pen eYdzdMB?editors=0010 by GreenSock (@GreenSock) on CodePen 1 Link to comment Share on other sites More sharing options...
Carl Posted December 7, 2020 Share Posted December 7, 2020 Hi @monema I guess which approach you choose will depend on your needs but a few things to clarify adding a pause() inside a function inside a timeline isn't accurate and can cause problems when reversing (which is why addPause() was created) If you want to put a bunch of conditional logic inside the timeline that is synchronized with a pause its probably better to use addPause() with a callback tweenTo() and tweenFromTo() don't require any calculation of duration which is a big part of their convenience. tweenTo() and tweenFromTo() allow callbacks just like any tween so if you need to run a function after your animation plays you can put a callback on the tweenTo() instead of having it inside the timeline like:timeline.tweenTo("a", {onComplete:checkStatus"}) This may or not be important for your project. 5 Link to comment Share on other sites More sharing options...
monema Posted December 9, 2020 Author Share Posted December 9, 2020 Ok thank you very much i've solved looking at the first video. You're amazing! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now