Jump to content
Search Community

Slowing an animation down.

chris_hildreth test
Moderator Tag

Recommended Posts

Hi all

 

Is there an easy way to create an animation for a swinging sign that slows down and stops?

 

For example, this makes it swing back and forth, but i wanted it it slow down and stop. 

 

TweenMax.fromTo(open_sign.sign, .5, {rotation:20},{rotation:-20,ease:Sine.easeInOut,repeat:10,yoyo:true});
 

 

thanks! 

Link to comment
Share on other sites

Hi and welcome to the GreenSock forums.

 

There are a number of ways you can slow down a tween.

You can tween the time(), progress(), totalTime(), totalProgress() and even the timeScale() of a tween. While you are tweening your tween, you can also apply easing for some very cool effects.

 

Try the following

 

var swing:TweenMax = TweenMax.fromTo(open_sign.sign, .5, {rotation:20},{rotation:-20,ease:Sine.easeInOut,repeat:10,yoyo:true, paused:true});


trace(swing.totalDuration());


TweenLite.to(swing, swing.totalDuration()*1.5, {totalTime:swing.totalDuration()-0.25, ease:Power1.easeOut});
 
The code above will make the swing tween slow down and land at 0 rotation.
 
It may not be the most realistic swing effect as that would also require that the object rotates less over time. 
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...