Jump to content
Search Community

GSAP rotate shake wobble

TonyUK test
Moderator Tag

Go to solution Solved by GreenSock,

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

Hi,

 

I wonder if anyone can help with this.

 

I would like the reclangle to shake with rotation: 20, to rotation:-20, decreasing til it stops at its original rotation...which is 0.

 

TweenLite.fromTo("#rect", 2, { rotation: 20}, { rotation: -20, ease: RoughEase.ease.config({ strength: 5, points: 20, taper:"out", randomize: false}), clearProps: "rotation"});         
};

 

The problem is that because the "To" bit of the tween is a rotation value, so the rectangle shakes back and forth fine, but gradually going to the rotation: -20 (which i dont want).

 

Any ideas please?

See the Pen rWLxXv by Tony5587 (@Tony5587) on CodePen

  • Like 1
Link to comment
Share on other sites

  • Solution

I have very good news for you. :)

 

We're getting close to releasing CustomEase and CustomWiggle which will make this effect SUPER easy to create and tweak. Both tools are available to Club GreenSock members already. Here's a fork of your codepen, using CustomWiggle (which leverages CustomEase under the hood):

http://codepen.io/anon/pen/xROOwZ?editors=0010

 

Here's another demo that shows various "types" of wiggles: 

http://codepen.io/GreenSock/pen/LRqkOr?editors=0010

 

And of course you can tweak the number of wiggles too. 

 

To learn about CustomEase, check out this pre-release video: 

 

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