Jump to content
Search Community

The case of the disappearing pulsation...

Gary 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

Alright, this one's really got me scratching my head.  The codepen has a simple timeline that spins some text in, pulsates the text in and out a few times, and then fades the text out.  The pulsation works over and over again if you restart before the pulsation ends.  However, if you let it continue on to the fade out tween and then restart, the pulsation no longer works.

 

See the Pen dLKsn?editors=001 by GaryC (@GaryC) on CodePen

Link to comment
Share on other sites

There's an overlap of the repeating tween and the following tween causing the pulsation to be overwritten.

You've used repeat: 4, which means it will play once, then repeat 4 more times. The duration of that tween is 1.5s. The following tween has an insertion point of 0 and a delay of 4.2 (it would really be clearer if you removed the delay, and just inserted at 4.2). These tweens overlap and on the first play it works ok, since immediateRender is false, but once that overlapping tween plays for the first time the overwrite rules will kill the scalex/scaleY of any conflicting tweens - hence the repeating tween never run again.

You can change the repeat to 3, which will give you the number of repeats it seems you want (i.e. 4 total plays - 2 forward, 2 in reverse) and avoids the overwrite issue. If you need to overlap tweens like this though, you can always change the overwrite values mentioned in the docs

  • Like 4
Link to comment
Share on other sites

Thanks, Jamie.  I changed the default overwrite to none and that fixed it.  It looks like that changes it to a last-one-wins scenario, which was my original expectation.

 

Thanks for the help!

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