FLIXITY
Expressions are one of those things in After Effects that sound complicated but once you get the basics down, you'll wonder how you ever worked without them.
If you've seen the word "expressions" and immediately scrolled past it thinking "that's for advanced users" - this article is for you. I'm going to break it down as simply as possible, with real examples you can use right away.
An expression is a small piece of code that controls a property in After Effects automatically. Instead of manually setting keyframes, you write a short instruction and After Effects does the work for you.
For example, instead of animating a layer to constantly spin by setting dozens of keyframes, you can type one short expression and it spins forever on its own.
Don't worry - you don't need to be a programmer. Most useful expressions in After Effects are short, simple, and easy to copy and modify.
That's it. The property now runs on the expression instead of keyframes.
To remove an expression, just hold Alt/Option and click the stopwatch again.
wiggle(2, 30)This makes a layer wiggle randomly. The first number is how many times per second it wiggles, and the second is how far it moves in pixels.
So wiggle(2, 30) means: wiggle 2 times per second, moving up to 30 pixels in any direction.
Try it on a layer's Position property. It's great for handheld camera effects, shaking objects, or adding life to static elements.
time * 100If you apply this to the Rotation property, the layer will spin continuously. time is simply the current time in seconds. Multiply it by a number and you control the speed.
time * 100 = rotates 100 degrees per second
time * 360 = one full rotation per second
loopOut("cycle")If you've animated something with keyframes and you want it to repeat forever, apply loopOut("cycle") to that property. It takes your keyframed animation and loops it continuously.
Other useful variations:
loopOut("pingpong") - plays forward then backwardloopIn("cycle") - loops before your first keyframevalue + wiggle(3, 5)Instead of replacing your position entirely with random movement, it adds the wiggle on top of whatever position your layer is already at. More predictable and useful in real projects.
[thisComp.width / 2, thisComp.height / 2]Apply this to the Position property and the layer will always stay perfectly centered in your composition - no matter what size your comp is.
Forgetting Alt/Option when clicking the stopwatch - If you just click the stopwatch normally, you're setting a keyframe, not adding an expression.
Mixing up the commas - Expressions use standard JavaScript syntax. A missing comma or bracket will cause an error.
Deleting expressions by accident - If you hit the stopwatch without Alt, your expression gets replaced with a keyframe.
Expressions aren't as scary as they look. Start with wiggle - just add it to a position property and play with the numbers. Once you see how it works, the concept of expressions clicks into place pretty quickly.
You don't need to understand all the math behind it. Just know what each expression does, where to apply it, and how to tweak the numbers. That alone covers 80% of real-world After Effects expression use.
FLIXITY YouTube Channel Content Creator