After Effects Expressions: A Simple Guide to my Top 5 Expression Concepts
- Noel Powell
- 2 days ago
- 3 min read
If you’re new to expressions in After Effects, it might seem like they’re only for coders or super-technical animators. With no coding background, I remember being intimidated by expressions for my first few years of using After Effects. But trust me — even learning a few of the most simple expressions will take After Effects functionality (and your animations) to a whole new level. Expressions are just short bits of code that let you automate animation without keyframes, link properties together, or achieve a level of control over your animations that you can't get from keyframing properties.
Over the years of building motion graphics and After Effects templates, I’ve found myself reaching for the same small handful of expressions again and again. These aren’t advanced or complicated — they’re simple, useful, and powerful! Expressions can be used on any property. To test out any of the following expressions in After Effects, first open an expression box for the Rotation property of a layer in your timeline (Alt+click or Option+click the small stopwatch icon next the property's name). Copy the code into the expression box.

1. Wiggle – Add Natural, Random Motion
The Wiggle function is easily the most well-known and common tool used in After Effects expressions. It lets you add smooth or jittery movement, or fluctuation, to any property without keyframes — perfect for shaking a camera, flickering a light, or floating an object.
Example: wiggle(3, 20)
This simple code on the Rotation property of a layer will randomly rotate the layer back and forth an amount of 20°, at a speed of about 2 times per second. Try a speed (the first value) of 0.5 to see how the rotation slows down. The expression adds fluctuation to the current value of the property, so you can still add keyframed animation to the property, and it will combine it with the wiggle.
2. Random – Controlled Randomness with random() and seedRandom()
The random() function gives a property a different random number every time it runs — great for adding variety between layers.
Example: random(50, 100)
This will make the rotation essentially behave like a very fast wiggle. It will create a new value between 50 and 100 that changes on every frame. That is more randomness than most people need, so we'll lock it down using seedRandom().
seedRandom(index, true);
random(50, 100); By adding seedRandom(index, true);, we’re telling After Effects to generate a unique, but consistent random value for each layer. index ensures that each layer gets a different value. true locks the randomness so it stays the same on every frame. That way, each layer gets its own number between 50 and 100 — but it doesn’t keep changing. It’s perfect for creating stable, varied values like staggered positions, scale, or opacity across multiple layers.
3. time * value – Steady Motion Over Time
The time variable is incredibly simple and incredibly useful. It just returns the current time (in seconds). Multiply it by a number, and you’ve got constant motion without any keyframes.
Example: time * 30
Each second, this will increase the value by an amount of 30.
4. if/else – Add Logic to Your Animation
The if/else statement tells After Effects to do one thing if a condition is true, and something else if it’s false.
if (time < 3) {
0
} else {
100
}
The first line evaluates the condition time < 3. If the time is less than 3 seconds, the value of the property will be 0. 3 seconds into the animation, the value will jump to 100. You can use if/else to control when things appear, change opacity, or trigger behaviors from sliders or checkboxes.
5. LoopOut – Repeat Your Keyframes Forever
If you’ve ever wanted an animation to repeat automatically, this is the shortcut. Apply keyframes to a property, then add the expression:
loopOut()
It will loop your keyframed animation endlessly. You can also customize it:
loopOut("pingpong")
This makes the animation bounce back and forth. Great for cycling effects, animated icons, or anything you want to repeat without duplicating keyframes.
Final Thoughts
You don’t have to memorize every expression in After Effects. These five simple concepts can open up a huge amount of creative power. Try adding one to your next project — you’ll start to see how expressions can save time, reduce keyframes, and make your animations more dynamic with just a few lines of code. For a great resource on learning expressions, you can check out Dan Ebbert's articles at MotionScript.com. Dan has the clearest and best explanation of expressions out there.
Commentaires