Jump to content
Search Community

Two timelines one problem

VicUK 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

Hi there I have a very particular problem I have two animations one triggered on scroll at a certain point it reaches stopping point once that happens the yoyo idle animation kicks in which happens until you start scrolling again. They idle animation rotates and wobbles the elements in the animation. 

 

The scroll animation is a sequence of fromTo's and idle is a sequence of To with repeat -1 and yoyo.

 

Anyway when the next scroll happens I stop the animation and run the scrolling one again - now what I need it to do at the point of stopping the idle animation and start of the new animation the existing values on the transforms left over from the idle to gradually animate to the start of the scroll triggered animation so there is no jolt when the scroll happens.

 

Due to NDA I can't post any source.

 

What I basically need is for one animation to start from where the other has left off and nicely animate to values where the other starts.

Link to comment
Share on other sites

I'd echo Diaco's request for a reduced test case (demo), but if I understand your description properly I wonder if it'd be as simple as calling invalidate() on the "scrolling" animation. What that'd to is basically tell all the tweens to dump any recorded starting values (those get recorded the first time the tween renders) and re-instantiate. Maybe try that and let us know if it solves things for you. Or another solution may be to just tween the values to where you want them to start (where the "scrolling" ones begin) before you resume() it. 

  • Like 2
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...