Share Posted April 8, 2022 How can i chain timelines which waits for the last one to finish? Do i have to calculate manually the length of the last timeline added with tl.add(tl1) (tl1.duration())? I would like to play the added timelines as "chained clips", same behavior as tl.to() or tl.from(), but for timelines, not individual animations. const tl1 = getMy10sAnimation1() //gsap.timeline() ...to().to().to()... const tl2 = getMy2sAnimation1() //gsap.timeline() const tl3 = getMy7sAnimation1() //gsap.timeline() const masterTl = gsap.timeline({repeat: -1}) .add(tl1) .add(tl2) .add(tl3) // expected result: // ----------- // -- // --------- // repeat // but i get: // ----------- // -- // ------- Link to comment Share on other sites More sharing options...
Share Posted April 8, 2022 Hi and welcome to the GreenSock forums, Without seeing all your code, my guess is that the functions like getMy10sAnimation1() are not returning the animations as shown in the demo below. Your functions are probably just creating the animations as soon as being called. You could log masterTl.duration() for further investigation. See the Pen jOYxVpm??editors=1010 by snorkltv (@snorkltv) on CodePen If you need more help please provide a minimal demo 4 Link to comment Share on other sites More sharing options...
Author Share Posted April 8, 2022 i thought just the callback which provides the animation would be enough, but the tl reference itself needs to be passed to tl.add(tl, not () => tl), works now thank you 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