Jump to content
Search Community

keep infinitely looping timelines separated in time

antialias 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

Suppose you had an infinitely looping timeline of duration 60 seconds, and a second infinitely looping timeline of duration 61 seconds. How would you have them playing concurrently so they stay separated in time? I am making a generative artwork and want to have the animation sequences shift against each other in time, as you would do with audio loops of slightly different durations. 

Link to comment
Share on other sites

I'm not sure I follow your question. Are you saying you want the two timelines in this scenario to always restart at the same time? If so, you can set a repeatDelay on the timeline with the shorter duration. 

 

If I've misunderstood your question, could you please add a few more details? Thanks.

  • Like 1
Link to comment
Share on other sites

Thanks Carl, 
I want the timelines to restart independently so that they phase against each other. I just tried this test:

 

////////////////////// timeline 4 plane 3

                 var tl4 = new TimelineMax( {paused:false, repeat:-1, id: 'one' }) 
         
             
                 
                 tl4.to(plane3.scale, 5, {delay: 5, x: 3.0, ease:Power1.easeInOut }) // scale plane 3

                 tl4.to(plane3.scale, 5, {delay: 5, x: 2.0, ease:Power1.easeInOut }) // scale plane 3

      ////////////////////// timeline 5 plane 4 ////////////////////////////////////////////////////////////////

                 var tl5 = new TimelineMax( {paused:false, repeat:-1, id:'two'}) 
         
             
                 
                 tl5.to(plane4.scale, 4, {delay: 5, y: 2.0, ease:Power1.easeInOut }) // scale plane 4 

                 tl5.to(plane4.scale, 4, {delay: 5, y: 0.5, ease:Power1.easeInOut }) // scale plane 4


////////

The timelines restart in sync after the global timeline loops, even though the DevTools gui shows durations of 20 and 18 seconds respectively. I want them to get slowly out of sync. Do I need two global timelines? 

Link to comment
Share on other sites

Is that the only animations you have in each timeline? And you're placing both of those timelines into a master timeline? I think the missing piece is the master one (assuming you're using one) - you didn't show that in your code anywhere. We need to see how you're positioning things there. Can you please provide a reduced test case in codepen? That'd sure help in terms of troubleshooting. 

 

I wonder if it's only showing that way because you're using GSDevTools which, when it finds an infinitely repeating animation, treats it as if it's not (otherwise it'd make using GSDevTools totally unintuitive since the slider would be infinite). Are you getting the same behavior WITHOUT GSDevTools? 

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