Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
bluntcoder

Teetering effect in a slide (with rotation at base)

Recommended Posts

Hey everyone,

 

Image you have a cartoony chess game. And you're sliding the queen from one end of the board to the other. I want to add a teetering effect, with the piece pivots on it's base a bit to begin it's slide, and then teeters in the other direction when it ends. 

 

 I have the pivot centre at the bottom center, but I can't seem to find an elegant way to pivot back and forth. So what I've done is:

var maxTilt:Number = 10; // degrees
var slide:TimelineLite = new TimelineLite( { autoDispose:true } );
slide.add(TweenMax.to(obj, DURATION / 4, { rotation: -maxTilt} ));
slide.add(TweenMax.to(obj, DURATION / 2, { rotation: maxTilt } ));
slide.add(TweenMax.to(obj, slide.add(TweenMax.to(obj, DURATION, { startAt: { x:from.x, y:from.y }, x:to.x, y:to.y, ease: Back.easeInOut.config(1.0) } ), 0);
			DURATION / 4, { rotation: 0} ));

Problem is the nice ease effects can't be transitioned between the tils. Is the best way to do this? I hope not.

 

Thank you!

   Mark 

Link to comment
Share on other sites

Kind of tough to know exactly what is happening without seeing it. But, yes to get those very subtle effects it just sometimes takes a lot of experimenting with the timing and eases. You may even need a few more tweens that rotate to different values to make it look like its wobbling less over time.

 

Another idea is to try an Elastic ease.

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