Jump to content
Search Community

GSAP wiggle, and keep random positions

celli 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

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.

See the Pen wgJXMG by celli (@celli) on CodePen

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