How to use the Wiggle Expression in After Effects.
It's no secret, expressions are a powerful way to automate tedious animations. And, One of the best expressions you can learn in After Effects is the wiggle expression. The wiggle expression is an easy to learn expression in After Effects, and it will be your friend all throughout your career.
Careful though, the wiggle expression will make you start questioning why you don't know more expressions. Eventually you'll be looking for more and more ways to automate movements using code in After Effects. But what can you use the wiggle expression for? Well...
- Want to animate a lot of little things, but you don't want to keyframe all their movements? Wiggle Expression!
- Want to add a subtle camera shake in After Effects? Wiggle Expression!
- How do you make a light flicker in After Effects? Wiggle Expression!
Okay, okay, that's enough selling the wiggle expression. Let's learn how to use it!
What is the Wiggle Expression?
So, the wiggle expression can be complicated, and it can be simple. It really depends on what kind of control you need. For example, here's a fully expanded wiggle expression in After Effects; it's quite lengthy...
wiggle(freq, amp, octaves = 1, amp_mult = .5, t = time)
There is a lot going on there, and we really don't need all of that to get started. Instead, let's break it down a more basic version of the wiggle expression so you can focus on what's needed to get started.
That seems way less scary! In fact, the minimum code you need to write when using the wiggle expression is just two simple parts:
- Frequency (freq) - How often do you want your value (number) to move per second.
- Amplitude (amp) - How much your value is allowed to change above or below the starting value.
So if you copy and paste the wiggle expression below into a property (position, rotation, etc.) in After Effects you will have a value that jumps around 3 times a second up to 15 points above or below the original starting value.
In short, to use the wiggle expression in After Effects just follow these quick steps:
- Option (alt on PC) + click on the stopwatch icon next to your desired property.
- Type in wiggle(
- Add your Frequency (Example: 4)
- Add a comma (,)
- Add your Amplitude Value (Example: 30)
- Add ); to the end.
That's all there is to it. Your wiggle expression will now work on your property. If the wiggle expression above was written out it'd look like this:
Let's look at some visual examples to help that sink in.
Changing Wiggle Expression Values
To help get a clearer understanding of what's going on, I've created a few wiggle expression GIFs that show what happens when frequency and amplitude are changed. For these examples I isolated the x position of the layers to help illustrate the point.
As you can see above, the higher the value frequency input, the more wiggles After Effects produces per second.
The higher you increase amplitude, the further your layer will move from its original position.
This can be used for many more things than just position! The wiggle expression can be added to to any of the transform properties like rotation, scale, and many effects within After Effects. If there is a number value needed for the effects, then you can apply wiggle.
The Value in Wiggles
Those were just a few use cases for how you can use the wiggle expression in After Effects. Keep messing with the wiggle expression and seeing what you can come up with. Even though it's simple at its core, it can be incredibly useful in day-to-day After Effects work.
For some advanced wiggling, Dan Ebberts (the Godfather of After Effects expressions) has an article on his site that shows us how to loop the wiggle expression. There you can learn how to maximize the use of the entire wiggle expression.
Want to Learn More?
If you want to learn more about using expressions in After Effects we have a ton of other great expression content here on School of Motion. Here are a few of our favorite tutorials:
- Amazing Expressions in After Effects
- After Effects Expressions 101
- How to Use the Loop Expression
- How to Use the Bounce Expression in After Effects
Also, if you really love learning expressions, check out Expression Session!