Home / Blog

Wiggle Expression in After Effects: A Practical Guide With Examples

How the wiggle expression in After Effects works, plus copy-ready examples: one axis, sliders, start and stop, choppy motion and seamless loops.

Top 10 Ways to Use the AI Assistant in After Effects

The wiggle expression in After Effects is the first expression most motion designers learn, and for good reason: one short line adds random, organic movement to almost any property. This guide covers how wiggle works, what its numbers mean, and the variations you’ll actually use: wiggling one axis, controlling it with sliders, starting and stopping it, slowing it down and making it loop.

How the After Effects wiggle expression works

Wiggle takes a property’s current value and adds random variation to it over time. To add it, hold Alt (Windows) or Option (macOS) and click the stopwatch next to a property, then type:

wiggle(2, 30)

The two numbers are the ones you’ll change most:

  • Frequency (2): how many times per second the value changes direction. Low numbers feel floaty; high numbers feel jittery.
  • Amplitude (30): how far the value can move from its original value, in that property’s units. On Position that’s pixels, on Rotation it’s degrees, on Opacity it’s percent.

Because wiggle works on top of the existing value, you can still keyframe the property. The layer follows the keyframes and wiggles around them.

Wiggle on different properties

  • Position: wiggle(1, 20) gives a gentle float for icons and badges.
  • Rotation: wiggle(3, 5) adds a small nervous shake.
  • Scale: wiggle(2, 4) makes a subtle pulse. Note that X and Y wiggle separately, which can distort the layer; see the next section.
  • Opacity: wiggle(10, 40) creates a flicker for neon and glitch looks.

Wiggle only one axis

By default, wiggle on Position moves the layer in both X and Y. To wiggle only horizontally, store the result and keep the original Y value:

w = wiggle(2, 30);
[w[0], value[1]]

For vertical only, swap them: [value[0], w[1]]. For Scale, where you usually want X and Y to move together, use the same random value for both:

w = wiggle(2, 5);
[w[0], w[0]]

Control wiggle with sliders

Typing numbers into an expression gets slow when a client asks for “a bit less movement”. Add two Slider Controls instead (Effect > Expression Controls > Slider Control), rename them Frequency and Amplitude, and link them:

freq = effect("Frequency")("Slider");
amp = effect("Amplitude")("Slider");
wiggle(freq, amp)

Now you can adjust the wiggle from the Effect Controls panel, and even keyframe the amplitude to make the shake build up and calm down.

Start and stop the wiggle

To start wiggling at a certain time, check the current time first:

time > 2 ? wiggle(2, 30) : value

A smoother approach is to keyframe the Amplitude slider from 0 to the full value, so the movement eases in instead of snapping on.

Make the wiggle choppier or slower

Sometimes you want a stepped, stop-motion feel rather than smooth movement. Add posterizeTime before the wiggle to update it only a few times per second:

posterizeTime(8);
wiggle(3, 20)

This updates the value 8 times per second, which works well for hand-drawn and retro looks.

Make a looping wiggle

Wiggle never repeats, which is a problem for looping social clips and GIFs. A common solution blends two wiggles so that the end matches the start:

freq = 1;
amp = 50;
loopTime = 3;
t = time % loopTime;
w1 = wiggle(freq, amp, 1, 0.5, t);
w2 = wiggle(freq, amp, 1, 0.5, t - loopTime);
linear(t, 0, loopTime, w1, w2)

Set loopTime to the length of your loop in seconds. The extra arguments are octaves (1), amplitude multiplier (0.5) and the time to sample (t).

Add detail with octaves

Wiggle has three optional arguments after frequency and amplitude: wiggle(freq, amp, octaves, amp_mult, t). Octaves adds extra layers of smaller, faster noise on top of the main movement, and amp_mult sets how strong each extra layer is compared with the one before. The defaults are 1 octave and 0.5.

wiggle(1, 40, 3, 0.5)

With 3 octaves, a slow float picks up fine trembling detail, which is useful for things like a leaf in the wind or a shaky hand-drawn line. Keep octaves low: a value of 2 or 3 is usually plenty.

Wiggle vs a real camera move

Wiggle is great for small objects, but a wiggled camera usually looks artificial: it shakes in all directions equally, with none of the drift and weight of a real operator. For camera moves, our free Phone Camera Controller for After Effects lets you record genuine handheld motion with your phone. We explain the difference in our guide to creating a realistic handheld camera in After Effects.

And if you’d rather not write expressions at all, our AI Assistant for After Effects can add them from a prompt such as “Add small wiggle effect to the position of all selected layers”, applied to every selected layer at once.

Common wiggle problems

  • An error about the wrong number of dimensions. You’re probably returning a single number on a two-dimensional property. Return an array like [w[0], value[1]].
  • The layer jumps off screen. The amplitude is too high for that property. Start small and increase it.
  • Nothing happens. Check that the expression is enabled (the equals sign next to the property) and that the frequency isn’t 0.

FAQ

What do the numbers in wiggle mean?

The first number is frequency, how many times per second the value changes. The second is amplitude, how far it can move from its original value in that property’s units.

How do I wiggle only the X position in After Effects?

Use w = wiggle(2, 30); [w[0], value[1]]. That keeps the original Y value and wiggles only X.

Can I keyframe a wiggle?

Not directly, but you can link the frequency and amplitude to Slider Controls and keyframe those sliders.

How do I make a wiggle loop seamlessly?

Blend two wiggles sampled one loop apart with the linear() function, as in the looping wiggle example above.

Studio list

Get new tools and free drops first

One email when a new plugin, template or free pack is out. No spam, unsubscribe any time.

AI Assistant for After Effects

Try every prompt from this blog inside After Effects

ChatGPT in a panel: describe what you want and get scripts, expressions and animations back. Free with 10 prompts a day.