common.loading

Creating a Dynamic Timer in After Effects

0
Helpful
0
Not Helpful

Today, I’m going to show you how to create a dynamic timer in After Effects. If you are broadcasting an event, need a countdown for a presentation, or want to display time in a fitness video, this method is perfect for you.

You can use this timer to display countdowns in events, create a counter for special occasions like New Year’s Eve, or help viewers track time in your content.

Creating a New Composition: First, go to New Composition and create a new composition. You can use a standard 1920x1080 resolution. Adjust the Duration based on your timer. For example, if you need a 1-hour timer, set it to 3600 seconds.

Adding the Timer Text: Select the Type Tool and type “00:00:00” to represent hours, minutes, and seconds. Use the Align Panel to center the text. If this panel is not visible, open it from Window > Align.

Adding the Slider Control Effect: Go to the Effects & Presets panel and search for Slider Control. Drag and drop the Slider Control effect onto your text layer. If you cannot see the panel, go to Window > Effects & Presets and make sure it is enabled.

Adding an Expression (Code) to Create the Timer: We need to add an Expression to the Source Text of our text layer. Click the arrow next to the text layer to expand the Text properties. Find Source Text and hold Alt (Windows) / Option (Mac) while clicking the stopwatch icon. A code editor will appear. Paste the following code:

slider = Math.round(effect("Slider Control")("Slider")); sec = slider % 60; x = Math.floor(slider / 60); min = x % 60; hour = Math.floor(slider / 3600); function addZero(n) { if (n < 10) return "0" + n; else return n; } addZero(hour) + ":" + addZero(min) + ":" + addZero(sec);

This code will convert the Slider Control value into an hour:minute:second format.

Adjusting the Timer: By changing the Slider Control value, you can make the time count up or down. To create a countdown, set the Slider Control to 3600 at the beginning. Add a keyframe at the start and set another keyframe at the end with a value of 0. This makes the timer count down to zero over time.

Automating the Countdown: Open the Timeline and create keyframes for the Slider Control effect. Example: Set 3600 at the start and 0 at the end. The timer will now automatically count down as the animation plays.

Share