Jump to content
Search Community

conveyor belt effect woes

squibn test
Moderator Tag

Recommended Posts

Hi all,

 

Having trouble executing what I thought was a fairly simple animation, wondered if anyone could tell me if this is the best way of doing this kind of animation...

 

What I've got is a simple conveyor belt with several boxes on it, what I'm trying to do is make the boxes look like they fall off the belt when they get to the end, the animation that I've put together does this but there are two problems with it, firstly the items only animate one at a time, when I actually need them to travel along the conveyor belt at the same time, secondly there is a slight pause between them getting to the end of the belt and them falling off.

 

This is my code so far...

import com.greensock.*;

var myTimeline:TimelineLite = new TimelineLite();

myTimeline.append(new TweenLite(box1, 5, {x:600}));
myTimeline.append(new TweenLite(box1, 0.5, {rotation:90, x:990, y:300, alpha:0}));
myTimeline.append(new TweenLite(box2, 5, {x:600})); 
myTimeline.append(new TweenLite(box2, 0.5, {rotation:90, x:990, y:300, alpha:0}));
myTimeline.append(new TweenLite(box3, 5, {x:600})); 
myTimeline.append(new TweenLite(box3, 0.5, {rotation:90, x:990, y:300, alpha:0}));

Anyone point me in the right direction? Here's hoping!

 

Cheers,

Squibn

Link to comment
Share on other sites

I see two problems:

 

1) You're appending your tweens instead of inserting them. append() will always add the tween to the END of the timeline. It's a great way to build a sequence, but if you want all your stuff to animate at the same time, you should insert() them where you want them (maybe at the 0 position?)

 

2) I'm pretty sure there's not a delay between the time the sliding tween ends and the falling one starts - it just LOOKS that way because the default easing equation is an easeOut. So it slows down at the end. If you use Linear.easeNone for your ease, you won't see any slowing down at the end.

 

You also might want to check out TweenMax's allTo() method because it can animate a bunch of things to the same values. Less code. Very convenient. And you can combine it with a timeline.insertMultiple() call easily to insert all the resulting tweens.

 

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