Jump to content
Search Community

Problem with animation after the 1st loop

ProMogr 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 and welcome to the GreenSock forums,

 

Thanks for the demo. Its very helpful but in the future please make some effort to reduce it to the bare amount of code.

Right now the duration is 30 seconds long. Fortunately we can speed it up with timeScale() but if you can get the problem to occur with 2 messages that's fine. We don't need to see all the messages.

 

When you have an animation that doesn't play the same on multiple iterations it is usually due to overlapping tweens causing an overwrite. You were using negative position parameters on the ball tweens which means a new ball tween was starting while another was playing.

Since the ball tweens are the issue you can set overwrite:"none" on them

 

See the Pen wYpdNV?editors=0010 by anon (@anon) on CodePen

 

To test if an overwrite is the problem, you can add this to your code:

 

  TweenLite.onOverwrite = function() {
    console.log("overwrite")
  }

 

More info on overwriting can be found here: https://greensock.com/docs/TweenLite/static.onOverwrite

 

Also, I noticed you have onComplete callback set on your timeline. Timelines that repeat infinitely (repeat:-1) will never complete.

  • Like 5
Link to comment
Share on other sites

Seconding what @Carl said! Tip: It might be helpful to use labels to your timeline to sync up your animations and avoid overwriting/overlapping timelines (https://greensock.com/docs/TimelineLite/addLabel()). Using labels makes it so you don't have to add a negative delay to start two+ tweens at the same time, and it will make your synced up tweens/delays much easier to read.

 

 

 

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