Staggering animations in TimelineLite
Many times you will want to add a pile of animations into a timeline but with a slight delay between each animation. That is exactly where staggering comes in. In this lesson, we will integrate staggering into animations.
Video Transcript
00:00Congratulations! You are now in the end of chapter 2.
00:05And as we complete this chapter, I wanted to wrap up the topic of the add function.
00:10And by the way, a lot of what we're going to do in chapter 3 is going to be relatable to everything we did in this chapter,
00:15only we're going to move much faster, going through a lot more methods, because now you know what these stuff mean.
00:21In this lecture, we're going to talk about staggering effect, which will enable us to stagger our elements,
00:26basically adding a delay between those elements as they're added in.
00:30And this is, again, only relevant if we're using the add command and sending in more than one item.
00:36So let's take a deeper look into it and see how that works.
00:40After done, and with it, also the timeline add.
00:43We've seen the object that the add has the first property was the object, and we said it could be an array as well.
00:49We've looked at the position. We've just, in the last lesson, also seen the align,
00:54which we said the align could have a few different values of normal start or sequence.
01:00And the last item that we're going to look at is the stagger.
01:05Now, the stagger only works if the object is an array, just like the align does.
01:10So these properties are only relevant if you send in an array.
01:14In our case, that's exactly what we're doing.
01:16So the stagger definitely has a meaning and a purpose.
01:19And if we start with the normal item and we add a stagger, and again, the normal align basically says that we're going to respect the delays.
01:29Now, if I add here a value and a numeric value, that is, and add a numeric value of one second,
01:34what I'm basically saying is add the first item, add basically a delay of one second to this item,
01:40add a delay of another second to this one.
01:43So this will start a second, and this would start two seconds, and this would start.
01:47So if I save this, we're going to see that our animation is going to take a much longer amount of time as well,
01:51and there'll be basically this kind of like staggering effect, which is that's why it's called stagger, by the way.
01:57So if I go ahead here and just click on refresh, we're going to see that now we have the first item,
02:01the second item, and then the third item happening, and there is that delay going on between them,
02:08which is not very visual because of all the delays that we have here.
02:11But I'm going to leave it anyways.
02:13But basically, what's basically happening is we're having your one, two, three, they're happening one after each other,
02:18starting one after each other.
02:20If we want to look at it in a visual place, then we have here,
02:23if this was all starting before they were all starting at the same time,
02:27then now if we have like a second in between, then this item is not going to start at 45,
02:32but it will start at 60.
02:37And the third item is not going to start in 60, but it's going to start in 75.
02:46So then we have here basically the stagger effect going on.
02:50Now, as we said previously, the difference between normal and start remains the same.
02:56So if we're going to ignore that delay, then literally what's going to happen here
03:00is that we'll have here a delay of one second because this delay doesn't come into account at all.
03:04It's only going to be the stagger effect that we have here.
03:06So then we would see the zoom in happen basically literally a second in.
03:10It's going to be really quick even before this animation completes.
03:13So if we go ahead and just click on refresh here, we should see that after the zoom,
03:17the item is going to zoom in even before the animation finishes panning in exactly as we see here.
03:23And last but not least is that same control happens if we do the sequence,
03:29which basically says one after each other, then not only will they be one after each other,
03:33they're also going to have a delay of one second in between.
03:36So if I click here, we'll have the first item fade in.
03:40Then a second later, the next item should fade in, including all other delays.
03:46And literally between each animation that happens, there is a delay.
03:50Now, beyond that, before we wrap up this chapter,
03:53which is exactly what we're going to do right now, is you could also add negative values.
03:57So you could go ahead here and add minus one if you wanted the sequence to be basically
04:02with a minus one in between.
04:04So it would basically say that the sequence will basically run
04:07and one second before this item is over, then this one will add in and so on and so forth.
04:13So there'll be an overlap, but the overlap will not be very dramatic.
04:17So if I go ahead here and click on refresh, we're going to see that there is going to be
04:20an overlap between the items and inside of their animations, assuming that we don't have other delays going on.
04:30Well, we don't have other delays really going on, but let me just get rid of this anyways
04:35because we already got that topic sorted.
04:37I'll just put that there just in case you need it.
04:40And let me also set all the animations to be the exact same duration to make it very, very visual.
04:47So if we didn't put here anything and we just had a sequence, look how it's going to look like.
04:51So if I just said here nothing, each one is four seconds.
04:54So four seconds to fade in.
04:57When it's done fading in, four seconds to pan to zoom in more accurately
05:02and four seconds to pan to the bottom.
05:05And that's literally our four seconds.
05:07Now, on the other part, if we now say, okay, besides that it's a sequence,
05:11I also want to put a one second delay between them or let's make it even more dramatic.
05:15I'll put your four second delay.
05:17If I go ahead and click on refresh, we're going to have the fade in,
05:21which is going to take four seconds.
05:23When the fade in is complete, then for four seconds,
05:26it's going to stand still without doing anything.
05:29Only when those four seconds are over for four seconds, it's going to pan in.
05:33And then again, it's going to freeze for four seconds before it actually completes
05:37and animates to the bottom.
05:39So that's basically that.
05:41Now, contrary to that, although we don't want it to take so long,
05:43if I set here a minus, let's say three,
05:46I'm basically making sure that it's going to be one second, one second, one second.
05:50So they should basically be overlapping as they're animating.
05:53If I just make sure that I save that before I click on refresh
05:56and go here and click on refresh, we should see that now when it's going to animate,
06:00it's going to fade in and the item is going to pan in as well
06:03and it's all going to pan down as well.
06:05So one second in, another second in, another second in.
06:08So sometimes if it's hard for you to visualize what's going on in your learning,
06:12just make it bigger numbers and try to figure out that cinematic flow
06:16that we just did right now to make it very visual and very easy to comprehend.
06:20And with that said, we're done with the add function and with this chapter,
06:24but a lot of the things that we're going to cover in the next chapter
06:27are very much related to the fact that we could add more than one thing.
06:31They're related to that position control,
06:33which we're going to see that in a lot of other functions as well.
06:36It's going to relate also to that ruling of alignment
06:39whenever we're adding more than one thing.
06:41And also the idea of being able to stagger things
06:44and that's exactly how we're going to start the next chapter
06:47as we explore a lot of other different functions
06:50and see them in action using this type of mythology
06:54that exists throughout the timeline light and timeline max.
06:58So see you in the next lecture or next chapter more accurately
07:02when we take it a step deeper into the world of timeline light animations.
