Setting the rate at -1 means the countdown will decline by one number every second. The clockStart allows you to choose where the countdown will begin. The rest of the expression controls the time of the clock and ensures that the countdown changes every second. The second (optional) parameter specifies how many characters to extract. For example, the expression ('abcdef').substr(1,3) would return 'bcd'. The second parameter is optional, and if it is omitted, the characters from the first parameter through the end of the string are returned. So, the expression ('abcdef').substr(1) would return 'bcdef'.
Let’s add the option for the Timer to count up or down. First, add a new checkbox control in the effects panel, and rename it to Countdown. Now reference it in our expression. LoopOut (type = 'cycle') This expression repeats all keyframed animation, after the last keyframe, for the duration of the composition. The Loop “Cycle” expression is perfect for creating animated loops from as little as two keyframes.
Countdown in After Effects fundamental with simple theory and practices. After reading this article you will be more than capable to write your own simple countdown expressions.
A countdown is an act of counting numerals in reverse order to zero. In other words, is the number of seconds, minutes, or just frames that remain before something. Although, despite the theory, we can use it vice versa. Instead of going down, we can go up.
The way to create a countdown in After Effects is through simple expressions. Let’s see how we can create some variations of that.
We need two things in order to dive in and create all the variations of our countdown concepts.
Note: When you create the text layer, make sure you don’t write anything. Just leave it as it is. Also, set the frame rate for the new composition at 30 FPS.
One last thing. You could also use slider control in null object to control a countdown. Basically, you hook up the slider control to drive the countdown and then you just animate the slider control. You can find out more on How to make a simple count number.
Content of this article:
The most basic concept of countdown would be to just countdown negatively to infinity, right. Well at least as long as you have set up your timeline in After Effects. In my case, I have set up my timeline to 5 seconds. So any countdown will be happening in that time range, and repeat itself over and over again.
Let’s try this one.
Expand your text layer until you see the source text attribute. Alt + left click on the stop-watch icon to go into expression mode. Type: -time in the expression section. Play the animation.
As you can see, even though our animation is counting down from 0 to -2, something straight happening. There are decimals points. The way to fix it is through a function you have to add in the expression code. The function is Math.floor. So our new expression line of code will be:
Replace the expression line in After Effects for your text layer and once again play the animation.
Now the animation plays as we expected, right!
Note: For reverse effect, to go up, just remove the minus symbol. So, your expression code can be:
Let’s say for example we want to countdown in After Effects from 3 to zero. Just place the started number in front the minus time.
Let’s say you want to start from 100 and going up. You have to add your number and then adding the “+” symbol following by time:
The speed of all of the above countdown variations was depended on the frame rate we set up in the beginner for our new composition, which was 30 FPS. But what if we wanted for our countdown in After Effects to go faster or slower? What if we wanted for example our countdown to be 2 times faster.
It’s quite simple, to be honest.
It’s make sense, right?
Lets’ say we want to countdown to infinite two times faster. In three seconds it will be -6.
If we want to countdown to infinite two times slower, so in three seconds it will be -1.5 approximately, we have to replace the “*” symbol with “/”
Let’s say we want to countdown from 60 to 0 in 3 seconds. Our expression code will be:
In all above variations we countdown one by one. What if we want to countdown by ten! The way to do that is to multiply all the expression line by then number you want (10).
Our new expression code in After Effects for the our text layer will be:
Likewise, if you want your countdown to be happen by 20, or by 100, etc, your new expression code would be accordingly:
Now to have a countdown with decimal points you can use the previous expression code expect to replace the “*” symbol with “/” this time. So the expression code will be:
If you need more zeros in your countdown, just divide with a bigger number.