I remember someone in class asked how to make something bounce naturally using TweenLite (example: Ball Bounce).
I actually figured out a way to do it so it looks natural and it moves slightly to the right after the first bounce. I ended up using TweenMax and used the bezier plugin. The bezier plugin allows to make bounces appear more natural. Here is the code so you can play around with it if you want.
Hmmm, I think t hat was me. what I was looking to do was have this elf pop out of a draw and bounce back and forth... like a jack in the box. The project is live now so I had to settle for straight up and down bouncing.
I remember someone in class asked how to make something bounce naturally using TweenLite (example: Ball Bounce).
ReplyDeleteI actually figured out a way to do it so it looks natural and it moves slightly to the right after the first bounce. I ended up using TweenMax and used the bezier plugin. The bezier plugin allows to make bounces appear more natural. Here is the code so you can play around with it if you want.
import com.greensock.*;
import com.greensock.easing.*;
TweenMax.to(mc, 2.6, {bezier:[{x:330.45, y:370.50}], orientToBezier:false, ease:Bounce.easeOut});
TweenMax.to(mc, .3, {delay: .05, x:350});
TweenMax.to(mc, .5, {delay: 1, x:400});
TweenMax.to(mc, 1, {delay: 1.4, x:440});
TweenMax.to(mc, 1, {delay: 1.7, x:460});
Hope that helps.
Cool! Good to know about the bezier plugin. Thanks.
ReplyDeleteHmmm, I think t hat was me. what I was looking to do was have this elf pop out of a draw and bounce back and forth... like a jack in the box. The project is live now so I had to settle for straight up and down bouncing.
ReplyDeleteSee:
http://tinyurl.com/ygkxf68
Click on todays date to see the elf pop out...