**Filters**

**Special Offer !**

# super easy animations – 5 After Effects Expressions

Published on

Motion graphics are always fun to watch, but creating them can often take hours of work. Luckily there’s this thing called ‘expressions’, which are basically blocks of code. These codes tell your layers how to behave and act. So with some creative codes, we can make stunning animations in seconds!

If you’re new to after effects, we suggest to first watch our introduction and then come back for these expressions.

The expressions below are all covered in the tutorial above and you can simply copy/paste them to your project!

## Bounce Expression

First create an animation (ie. scale 100 to 120% or position from left to right). Next apply bellow’s expression to the property you’ve key-framed to make the animation bounce.

```
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}
}
if (n == 0){
t = 0;
}else{
t = time - key(n).time;
}
if (n > 0 && t < 1){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
amp = .06;
freq = 3;
decay = 5.0;
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{
value;
}
```

## Wiggle Expression

Can be applied to any property, but works great on the **position** to create a natural camera movement.

`wiggle(1,50);`

## Squash and Stretch Expression

Apply it to the scale attribute of any object. Works best on icons or bullet points.

```
maxDev = 13; // max deviation in pixels
spd = 30; //speed of oscillation
decay = 1.0; //how fast it slows down
t = time - inPoint;
x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);
y = scale[0]*scale[1]/x;
[x,y]
```

## Motion Tail Expression

First animate the position of an object. Then apply bellow’s expression to the **position**:

```
delay = 5; //number of frames to delay
d = delay*thisComp.frameDuration*(index - 1);
thisComp.layer(1).position.valueAtTime(time - d)
```

And this code to the **opacity**:

```
opacityFactor = .75;
Math.pow(opacityFactor,index - 1)*100
```

Now simply duplicate that entire layer (CTRL + D / CMD +D) a couple of times.

## Timer Up or Down Expression

Create a text layer and apply the expression to the **source text** attribute.

```
//Define time values
var hour = Math.floor((time/60)/60);
var min = Math.floor(time/60);
var sec = Math.floor(time);
var mili = Math.floor(time*60);
// Cleaning up the values
if (mili > 59){ mili = mili - sec*60; }
if (mili < 10){ mili = "0" + mili; } if (sec > 59){ sec = sec - min*60; }
if (sec < 10){ sec = "0" + sec; } if (min >= 59){ min = min - hour*60; }
if (min < 10){ min = "0" + min; }
// no hour cleanup
if (hour < 10){ hour = "0" + hour; }
//Output
hour + ' : ' + min + ' : ' + sec + ' : ' + mili;
```

## Storyblocks

Big thanks to Storyblocks for their support. If you ever need stock footage for your video head over to them! Next to the 4K stock clips, they also have After Effects templates, Premiere Pro presets, overlay effects and so much more. Download unlimited video assets for a single price per year.

Jordy – that countdown timer expression is amazing – but I can’t figure out how you made an 8 hour timer when AE has a 3 hour duration limit.

Make (3 + 3 + 2) Time Videos and link them in Premier with Music

Thank you jordy. I really like the after effects and cinecom.net. I wish your all the best and do yours things.

WE LOVE CINECOME.NET

sdsadsf

how can expression study for making

we need an advance course on after effects.

Thank you professor.

Awesome sir

this is good

You and jannik (yannik) had ripped the software

super goooooooooooood bro

Thanks for this great resource! Just curious… I tried copying and pasting the expression for Squash and Stretch, which I was very excited to use. But in After Effects, it produces an error in Line 1 of the code: “expression result must be of dimension 2, not 1”. Also, I see a dialog box with the same message, saying the expression is disabled. I have no idea what this error means or how to fix it… I’m not knowledgeable enough about After Effects. I wonder if this is perhaps because After Effects has been updated since this article was written? Maybe it used to work but no longer does? Or maybe there’s a typo in it? Has anyone else had this issue? And how do I edit the code so that it works? Thanks so much!

I had this same issue. No luck fixing so far.

The correct code is:

maxDev = 13; // max deviation in pixels

spd = 30; //speed of oscillation

decay = 1.0; //how fast it slows down

t = time – inPoint;

x = scale[0] + maxDev*Math.sin(spd*t)/Math.exp(decay*t);

y = scale[0]*scale[1]/x;

[x,y]

Hi Jordy,

I have seen your lots of tutorials

I have been wanting to figure out a countdown for a while. This is such a wonderful blessing. Thank you!

I really like your works I enjoy watching at your tutorials

Hi Jordy,

I want to be like you.

Am a Ghanaian studying graphic design in college.

Jordy Top werk ook eens laten weten dat er fans zijn in België, altijd lachen als je de intro doet.

Ik volg je al even top hoe je alles brengt, en uw team doet ook goed hun best!

BDW rondel noemen ze in de US washer, keep up the good work, and as always stay creative.

I have seen your lots of tutorials. I am after effects artist want to know all expression but don’t know where will I get it. and I do live action short films too.

what should I do for more clear sound without noise?

I have seen your lots of tutorials. You have amazing work. I am after effects artist want to know all expression but don’t know where will I get it. and I do live action short films too.

what should I do for more clear sound without noise?

I came across this webpage. It has a list filled with expressions and people can add more themselves.

Maybe this is usefull for some of you.

http://exdb.filmage.nl

i loved your expressions thanks for sharing us

guud stuff *thumbsupp

Hi jordy,

I m ae student I want learn all expression in Ae.please send me tutorials videos and also guide us with ur new techniques of Ae videos.

Thank you & Regards

Rohit tandel

Thank’s Jordy, that’s amazing

Thanks sir for helping us.

Jordy

Enjoyed your demo but having trouble getting countdown and couple others to work. The countdown expression in your demo is different than the script you listed. Can’t get either to work. The listed on just shows 00 and no countdown.

Oops, was a little typo. Should work now 🙂