Jump to content
Search Community

staggerTo and repeat. increment a tweened value

Liam@II test
Moderator Tag

Go to solution Solved by Dipscom,

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

See the Pen KNyXNZ by Liamii (@Liamii) on CodePen

 

so all i want to do is... each time the animation repeats the vertical distance tweened is incrementally change by some amount.

 

right now the tweened value doesn't change at all and onRepeat is called for every instance within the stagger.

 

i want it to only be called once per cycle of animation.

 

thanks in advance

Link to comment
Share on other sites

Hey Liam,

 

You'll need to recreate the Tween if you want new values each time.

 

See the Pen YpEEVx?editors=1111 by dipscom (@dipscom) on CodePen

Thank you! i forgot about Cycle.

 

thats the first time I've seen the calling of a function from that position  (simplified your code )

 

TweenMax.staggerTo(".thing", 1, {x: 50} }, 0.1, myFunction ) }

 

Can you tell me how that differs from onComplete?

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