catico

Timeline animation is different when repeated

Recommended Posts

Hi,

 

I have a timeline which I created beforehand and put it on pause. Then on trigger I run it with 

tl.play(0)

it plays correctly the very first time but subsequent repeats are not right. What am I missing?

 

Thanks for help! 

Share this post


Link to post
Share on other sites

Something to do with the offsets ... I've removed them and it appears to be functioning as you would expect it to.

 

 

  • Like 4

Share this post


Link to post
Share on other sites

I'm not exactly sure what the animation is supposed to do I think it's supposed to do a kind of double blink but I believe the problem is because the timing on your second "blink" is overlapping the first one.

 

The first animation would end at 0.9 but your telling the second to start at 0.75.

  • Like 3

Share this post


Link to post
Share on other sites

yup. when you have two tweens at the same time trying to animate the same property of the same object you will cause an overwrite which means the new tween will kill the existing tween. Its wasteful to have 2 tweens fighting for control at the same time so GSAP has this optimization built in. So when you play your timeline again, some of the tweens have been killed thus making the animation look different.

 

2 solutions: 

 

  • change your timing so that tweens do no not overlap as the guys suggested
  • put overwrite:"none" on the offending tweens

 

demo of overwrite:"none"

 

EDIT : Previously had wrong demo here / fixed now

 

 

  • Like 4

Share this post


Link to post
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.