Jump to content
Search Community

Ignore. addPause() on tweenTo

Victor Work test
Moderator Tag

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

Just to be clear, the addPause() were being ignored on tweenTo(). the slowing down of the speed was caused by the eases (as Sahil said)

Demo below has no addPause()

 

See the Pen vRebNb?editors=0010 by GreenSock (@GreenSock) on CodePen

 

and to add an ease to a tweenTo() you can set that in the vars object

 

tweenTo(0, {ease:Bounce.easeOut});

 

notice the bounce on "go back"

 

See the Pen ZxXwWK?editors=0010 by GreenSock (@GreenSock) on CodePen

 

 

  • Like 2
Link to comment
Share on other sites

In that case you could try keeping all of the animations in your timeline with Linear eases and never play() the timeline. Always tweenTo() the next frame and add the ease to the tweenTo(). Doing this you will have to determine what the next label is, but getLabelAfter() will help

 

See the Pen wmPMNb?editors=0010 by GreenSock (@GreenSock) on CodePen

 

With the solution above you will notice a problem if you are tweening to label4 (or any label) and you hit the next go tl button while the animation is happening, then you are still going to end up at label4. So you may want to disable clicking while animations happen or work on a more robust approach where you use getLabelsArray() and increment an index each time you click and then tweenTo() the next label based on the new index value. Also, be careful to check that there is a label after. In other words, you can't tweenTo() label6 as it doesn't exist.

  • Like 5
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...