Jump to content
Search Community

staggerTo with variable end points?

tauab test
Moderator Tag

Go to solution Solved by Carl,

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

Hey guys,

 

I'm trying to animate an array of objects along a path using staggerTo and bezierThrough and I'd like each object to have a unique destination.

 

Is there an easy way to plug in the last x,y coordinates on a per object basis while using staggerTo?

Link to comment
Share on other sites

  • Solution

Nope. staggerTo()'s convenience is possible because it insists that all objects that are being tweened have the same end properties.

 

You will need to loop through your Array of objects and create a unique tween for each.

 

Here is an example that runs a loop to create similar, yet random bezier tweens for multiple items. The tweens are all added to a timeline (which may not be necessary for you)

 

http://codepen.io/GreenSock/pen/uhKIy?editors=001

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