[2024] How To Use The Wiggle Expression In After Effects

The Wiggle Expression in After Effects is a powerful tool that allows objects to move in a random pattern, enhancing animations like camera shakes or flickering lights. To utilize it, select the desired layer property, apply the expression, and adjust the frequency and amplitude parameters to achieve the desired movement.

November 24, 2023
[2024] How To Use The Wiggle Expression In After Effects
"Video editors relying on templates lack genuine skill and creativity."

What do you think? Submit your opinion to see what others have to say!

"It's Like Video Editing On Steroids!"
- Sebastian Navarro, FreeVisuals Editor
Endorsed by Adobe, Motion Array is the ULTIMATE tool for creating high-quality videos! Browse 15M+ assets for Premiere Pro, After Effects, FCPX & DaVinci!

Using JavaScript To Make An Element Wiggle In Adobe After Effects

Wiggle Expressions

Basic Wiggle

This is the basic wiggle expression for a simple random movement.

wiggle(5, 10);

Slow and Far Wiggle

Wiggle that moves the object far but at a slower rate.

wiggle(1, 70);

Medium Wiggle

A moderate wiggle that's faster than the previous but doesn't move as far.

wiggle(3, 20);

Fast and Short Wiggle

A quick wiggle that moves the object in short distances.

wiggle(11, 7);

What is the Wiggle Expression in After Effects?

The Wiggle Expression in After Effects, often referred to as AE Wiggle, allows objects to move in a random pattern. This can be used to create effects like a random camera shake, a flickering light, or even to give character joints a more natural, idle movement. It's a popular expression that many motion designers, including myself, find invaluable in various projects.

What Are Expressions in After Effects?

Before we delve into the Wiggle Expression, it's essential to understand what an expression is. In After Effects, an expression is a small piece of JavaScript code that you can apply to animated properties in your projects. This code evaluates to a single value for a specific layer property at a particular time. In simpler terms, you're setting a layer property value through code. For instance, properties like "Scale," "Position," or "Rotation" can be controlled using expressions. While it might seem daunting to think about coding, especially for those of us who identify more as creatives than coders, using expressions can significantly streamline your workflow and enhance your projects.

How to Use the Wiggle Expression:

  1. Adding an Expression: To add an expression, first, select the layer property you want to apply it to. You can access these properties by twirling down the small arrows on your layer or using hotkeys like "a" for Anchor, "s" for Scale, or "p" for Position. Once you've selected the property, right-click and choose "Edit Expression" or ALT-click the stopwatch icon next to the property. This will open the Expression Script Window in your timeline, where you can input your code.
  2. Writing the Wiggle Expression: A basic form of the Wiggle Expression looks like this: wiggle(5, 10);. Here, the first number (5) represents the frequency, indicating how fast the value should wiggle. The second number (10) denotes the amplitude, defining how far the value will wiggle. So, in this example, the value will wiggle five times per second and move up to 10 units (like pixels) from its original position.
  3. Advanced Usage: The Wiggle Expression can be expanded to include more parameters, allowing for more control. For instance, if you want to wiggle only in one dimension, such as the x-position, you would use variables and arrays to achieve this effect. This might sound complex, but with a bit of practice, it becomes second nature.
  4. To loop it, read here.