celli

GSAP wiggle, and keep random positions

Recommended Posts

I have a simple wiggle in the codePen example, and I'm trying to see if I can save the position after each circle moves into it's first position and then move it around again randomly (all within the blue box). Right now when it wiggles, it returns to it's original position in-between each wiggle. Is that possible ? I looked at the 'swarm' example, but I am having a hard time making sense of the code, and I really would like to see how I can capture the position after it moves out into position the first time, and then move each circle around from that position each time it wiggles around. Thanks in advance.

Share this post


Link to post
Share on other sites

Here are two options I whipped together: 

 

Using wiggles (more "swarmy")

http://codepen.io/GreenSock/pen/fd44a028769d09548f7ce9c2ca6ed02c/ (noticed I changed the cy to center the dots to begin with)

 

And a recursive tweening action in a function that calls itself onComplete (more "just moves to random spots"):

http://codepen.io/GreenSock/pen/d614fc7ea7b00eda57f752ea5b0ac792/

 

Do those help? 

  • Like 2

Share this post


Link to post
Share on other sites

yes, those are really great. Thanks! They give me some ideas.

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.