Master After Effects Wiggle Expression: Parameters, Tricks & Advanced Uses
This comprehensive guide explains the After Effects wiggle expression, detailing each of its five parameters—frequency, amplitude, octaves, amp_mult, and time—while offering practical examples, advanced techniques like seedRandom, directional control, looping, and time‑based activation to help designers use wiggle flexibly and efficiently.
Introduction
After Effects expressions are snippets of code that can be used without deep programming knowledge. Understanding the wiggle expression allows designers to create dynamic, random motion beyond simple plugin use.
Wiggle Syntax
The basic form is:
wiggle(freq, amp, octaves = 1, amp_mult = .5, t = time)Parameter Details
freq (frequency) : Determines how many cycles occur per second. Higher values produce faster oscillations. It has no default and must be provided.
amp (amplitude) : Controls the range of value change. Larger amplitudes increase the magnitude of movement. It also requires a value.
octaves : Adds harmonic layers to the base wave. Default is 1; valid integers are 0‑10. More octaves create more complex motion.
amp_mult : Scales the added harmonics. Default is 0.5 and only takes effect when octaves is greater than 1.
t (time) : Sets the time sample. By default it follows time, but a fixed number (e.g., t=5) freezes the wiggle at that moment.
Comparison with random
Both generate random values, but wiggle produces smooth, continuous changes and can return arrays (e.g., for position), whereas random yields a single value and requires array syntax for multi‑dimensional properties.
Controlling Random Seed
Wiggle’s randomness is tied to layer index. To make it independent, prepend seedRandom(seed, timeless) (e.g., seedRandom(5)) before the wiggle call.
Simple Applications
Common uses include adding wiggle to position, rotation, or opacity to create jitter, wing‑flap, or flash effects. Scaling typically requires more careful handling because non‑uniform values can look odd.
Directional Control
To keep both dimensions equal for uniform scaling, use array indexing: x = wiggle(1,30); [x[0], x[0]] Alternatively, link a slider to the expression and drive the value with a single dimension.
Case Studies
Case A – Directional Ball Swing
Horizontal swing: x = wiggle(1,1000); y = wiggle(1,0); [x[0], y[0]] 45° swing uses equal values for both axes.
Case B – Audio Spectrum Animation
1. Create a shape layer and set its anchor to the bottom.
2. Add two sliders (freq, amp) on a null layer and link them:
freq = thisComp.layer("Null").effect("freq")("Slider"); amp = thisComp.layer("Null").effect("amp")("Slider"); s = wiggle(freq, amp); [value[0], s[1]]3. Duplicate the shape layer and offset its position using index:
value + [200*(index-1), 0]Controlling Wiggle Duration
Three methods:
Split the layer and adjust its start point, optionally using seedRandom for seamless transition.
Link wiggle parameters to sliders and keyframe the sliders to zero outside the desired time range.
Use a pure expression to enable wiggle only between specific times, e.g.:
var w = wiggle(1,30); if (2 < time && time < 3) w; else 0;Looping Wiggle
To create a looping wiggle animation, use a time modulo and linear interpolation:
frequency = 1; amplitude = 40; secondsToLoop = 3; t = time % secondsToLoop; wiggle1 = wiggle(frequency, amplitude, 1, 0.5, t); wiggle2 = wiggle(frequency, amplitude, 1, 0.5, t - secondsToLoop); linear(t, 0, secondsToLoop, wiggle1, wiggle2)This approach samples time within a loop and interpolates between two wiggle instances to achieve seamless repetition.
Conclusion
The wiggle expression offers powerful, flexible random motion for After Effects. By mastering its parameters, seed control, directional handling, timing, and looping techniques, designers can replace many manual keyframes with concise, reusable expressions.
Zhaori User Experience
Zhaori Technology is a user-centered team of ambitious young people committed to implementing user experience throughout. We focus on continuous practice and innovation in product design, interaction design, experience design, and UI design. We hope to learn through sharing, grow through learning, and build a more professional UCD team.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
