Digital Clock and Timer Animation in After Effects
I will show you how to make a digital clock in After Effects with a few lines of code without using plugins.
First of all, what I need is a font suitable for digital clock. There are many fonts suitable for digital clock format on font sites. I will use Digital Dismay font for this tutorial.
I added an image to the background. So that is not just a single color background. I write the 88:88 characters we see in digital clocks on the scene, Center the text on the scene and make it look more beautiful.
Then open the properties of the text. You will see Source Text. We need expression codes to make any timing. Through expression codes, we can make animations that seem difficult in After Effects easier. In this project, these are the codes we will use to make a digital clock. I will leave below and copy and paste them.
I copy these codes and click on the icon on the left of the Source Text section here by pressing the Alt key on the keyboard. You will see a text field, a code field will open where you can enter the expressions. I paste the codes here with Ctrl + V.
rate = 1;
clockStart = 0;
function timerg(n){
if (n < 10) return "0" + n else return "" + n
}
clockTime = Math.max(clockStart + rate*(time - inPoint),0);
t = Math.floor(clockTime);
min = Math.floor((t%3600)/60);
sec = Math.floor(t%60);
min + ":" + timerg(sec)
This project contains an expression error solution
When I move the timeline from left to right, I will not see any movement. Because it gave an error here. It gave an expression error. To overcome this error, we are going to need to make a change in After Effects. In File > Project Settings window, you will see the Expression tab on the far right. There are two options to choose the infrastructure that I need to use to run the expression.
It didn’t run this because it’s the exciting JavaScript. If we change it to Legacy ExtendScript, the error will go away and the code will start running. When I move the timeline from left to right, you will see that it increases every one second.
There are two options we can change in this code. You will be able to edit it according to your own project. One of them is the Rate value. If I change the Rate value to, for example 10 here and play the scene, 10 values will change every second. So as soon as a second passes in real life, you will see it here.
There is also the clock start value. This value indicates what time it’ll start per second. Since it’s currently zero. When I start the timeline, it’ll start at zero. If I make it 10, it’ll start at 10. When the timeline is at the beginning. Look, if I make it 60, it’ll start from the first minute I told you that it is in seconds, if I make it 120, you can make an arrangement like starting from the second minutes.
You can change the design however you like in terms of design.
Popular Tutorials
If you are using Opacity to render Fade In and Fade Out effects in After Effects,…
I will talk about a little convenience on keyframes. Normally when we…
In this After Effects tutorial, learn how to create stunning 3D text…
I’ll show you have to make a simple sound wave with After…
I will show you how to write and export animated letters and…
We don’t really need a security camera to get security footage. In…