3d & animation

How to Create a Counter in After Effects in 7 min (TUTORIAL)

Learn to use basic expressions to create a counter that’s easy to edit and animate

When creating graphics in Adobe After Effects, often we need to include counters–numeric figures that either increase or decrease. Merely showing a percentage isn’t the same as animating it so that we see it go from zero to another number–this makes it much more attractive and eye-catching.

Yimbo–an animator and motion grapher–is an expert when it comes to working in After Effects, especially when using expressions. Expressions are mathematical formulas that can be interpreted by the program and that make our work a lot easier. Below, Yimbo explains step by step how to create a counter using expressions in After Effects.

Oh, and if you want to go ahead and use the expression that he uses, here it is. All you have to do is copy it:
n=effect(“Slider Control”)(“Slider”);
Math.floor(n) + “%”

Animating your text’s entrance

First of all, we can start by animating the number’s entrance into our composition and make it more interesting. Choosing our number in the timeline, we separate the values X and Y in order to only modify Y. Using keyframes, we choose the start and finishing positions of our number.

Exaggerating the animation

Once we have the number moving, we can make the animation more interesting by exaggerating it slightly. To do so, we select the keyframes in the timeline and press F9, which enables us to modify the curve of the text’s movement.

Save time using expressions

If we have a text linked to our number and we want both elements to enter the composition in the same way at the same time, we can use expressions to save time. To do so, once again we separate the X and Y values in our text and click Alt over Y so that we can connect the movement with the Y movement of our number.

If the text anchored to the number doesn’t end up in the position that we want it to (it appears above or underneath the number), we can add a “value+” to the Y expression. Now we can manipulate the Y coordinate of the text and put it wherever we want.

Adobe After Effects’ interface
Adobe After Effects’ interface

Creating the counter

Once we have linked the number and the text (or texts), we can start to create our counter.

Creating and linking the slider

To do so, we go to "Effects"> "Expression Control"> "Slider Control”; a slider will appear with all the numeric values of our counter.

We go to our number in our timeline and, opening the parameters of “Text”, we introduce the expression "Source Text” by pressing Alt. We write (without the inverted commas) “n=" and we link it to the slider that we previously opened by dragging the mouse from the expression to the slider itself. Finally, we close the line introducing “;".

Yimbo
Yimbo

Using Math.floor

If we now hit the space bar to play our counter, we will see that the numbers appear with decimals. If we only want whole numbers to appear, then we will need to use the expression “Math.floor". To do this, in the following line we introduce “n=", we just need to write (without inverted commas) "Math.floor (n)”. Now our counter will be rounded to whole numbers.

Adding the percentage

To add the percentage symbol, we just need to write the following in the expression: +”%”. This way the percentage sign will automatically appear next to our number.

Animating the scale of the number

If we still want to give a more exaggerated and eye-catching effect, we can make the number grow in size as the value increases. To do so, we just need to increase or decrease the scale of our number in the timeline by adding keyframes: one so that the number gets bigger and the other so that it gets smaller, according to the value shown.

Yimbo
Yimbo

You can watch the video below:

If you have found these tips useful, remember you can learn to create animations in a way that is easy, quick, and simple with Yimbo in his Domestika course, Express Animation for Social Media with After Effects.

If you want to learn to bring your characters alive and show their true personalities, try out his course, Basics of Character Animation with After Effects.

You may also like:

Introduction to After Effects, a course by Carlos "Zenzuke" Albarrán
Animation and Design of Characters in After Effects, a course by Moncho Massé
Expressive Motion Graphics Animations, a course by Sebastian Baptista
After Effects, Expressions for Motion Graphics, a course by Gabriel Suchowolski (microbians)

Recommended courses

Canva for Beginners: Create Professional Designs. Design course by Clàudia Cánovas

Canva for Beginners: Create Professional Designs

A course by Clàudia Cánovas

Learn the ins and outs of Canva while designing your own style guide and web page

  • 106,857
  • 96% (1.6K)
98% Disc.
Original price $49.99USD
Buy $0.99USD
Specialization in Graphic Design and Visual Communication. Design course by Domestika
Domestika Specialization · 18h

Specialization in Graphic Design and Visual Communication

A specialization by multiple teachers

Master's in Graphic Design: Master color, composition, and visual perception to create impactful and coherent visual identities.

  • 9,892
  • 100% (124)
FREE WITH PLUS
95% Disc.
Original price $129.99USD
Buy $5.99USD
Instagram Feed Design with Canva. Design course by Isabel Gil Loef

Instagram Feed Design with Canva

A course by Isabel Gil Loef

Learn how to create templates that make it easy for you to produce consistent, original, and impactful Instagram content

  • 68,766
  • 98% (1.4K)
98% Disc.
Original price $49.99USD
Buy $0.99USD
0 comments