JoelC Posted November 19, 2019 Share Posted November 19, 2019 My timeline is broken up into sections with pauses, and I'm using React state to trigger tweens to various sections. It's set up something like this: tl.addLabel('section1') .move(...) .move(...) .addPause() tl.addLabel('section2') .move(...) .addPause() tl.addLabel('section3') .move(...) .move(...) .addPause() So when I tween to section2, it'll go though the animations and then pause before section3, until the state is ready for it. My question is whether there's a straightforward way to have that pause be a looping animation, until a tween to section3 is triggered: tl.addLabel('section1') .move(...) .move(...) .addPause() tl.addLabel('section2') .move(...) .addPause() // infinite loop while waiting for next tween tl.addLabel('section3') .move(...) .move(...) .addPause() Thanks! Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 19, 2019 Share Posted November 19, 2019 Hey Joel, How about use an onComplete in the last .move() tween before the part where you want it to loop? tl.addLabel('section2') .move(..., onComplete: () => { tl.seek("section2"); }}) // infinite loop while waiting for next tween 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