JoelC Posted November 19, 2019 Share Posted November 19, 2019 Hi ? I'm using one long timeline for various React states, and the plan is to tween quickly to the correct label when my state changes. The problem is I can't figure out how to set a static duration (say, 0.5) for the tween in GSAP 3. Is there a way to do this? Also, I'd like the tween to ignore pauses I've added between each state (w/ tl.addPause()). Is this the expected behavior? Thanks! Link to comment Share on other sites More sharing options...
ZachSaucier Posted November 19, 2019 Share Posted November 19, 2019 Hey Joel, welcome to the forums! You can use tweenTo for this: const tl = gsap.timeline(); // add to tl, including pauses // later tl.tweenTo("someLabel").duration(0.5); // alternatively make a tween yourself gsap.to(tl, {duration: 0.5, time: tl.labels["someLabel"], ease: "none"}); Though I believe the default tween duration is 0.5s, so you could leave it out in this case. 14 hours ago, JoelC said: Is this the expected behavior? What do you mean? 2 Link to comment Share on other sites More sharing options...
JoelC Posted November 19, 2019 Author Share Posted November 19, 2019 The tweenTo.duration(0.5) version didn't work, but the second one did. Thanks so much! 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