Adds wiggle to just one axis (X, Y, or Z), leaving the others untouched. Great for controlled random movement.
// Wiggle only on X axis
freq = 3; // wiggles per second
amp = 50; // wiggle amount in pixels
w = wiggle(freq, amp);
[w[0], value[1]] // wiggle X, keep Y unchanged
// Wiggle only on Y axis
freq = 3; // wiggles per second
amp = 50; // wiggle amount in pixels
w = wiggle(freq, amp);
[value[0], w[1]] // keep X steady, wiggle Y
// Wiggle only on Z axis
freq = 3; // wiggles per second
amp = 50; // wiggle amount in pixels
w = wiggle(freq, amp);
[value[0], value[1], w[2]] // X and Y stay fixed, wiggle Z
You can apply this to any Position, Anchor Point, or any property that has multiple dimensions—even 3D effects or camera positions. Just make sure the layer is 3D if you’re using the Z option.
This one's super handy when you want randomness but only in one direction. Normally, wiggle(freq, amp)
affects all dimensions at once (X and Y, or X, Y, Z), which can get messy if you only want a subtle camera shake horizontally or just a vertical bounce.
So what this does is:
Runs wiggle()
like usual.
Stores the result in a variable w
, which contains the new [x, y] (or [x, y, z]) values.
Then we rebuild the original value, keeping the dimensions we don’t want to wiggle untouched.
That way, you get the wiggle you want exactly where you want it—no more, no less.
Just copy the full expression code from the top of this page. Then Alt-click (or Option-click on Mac) the stopwatch on the property you want to animate. Paste the code into the editor and that's it. If you’re not sure which property to use, check the "Where to Apply" section above.
First, make sure your project is using the JavaScript engine (go to File > Project Settings > Expressions). Also double-check for missing characters, and see if the code requires parenting a layer. If so, there will be a comment in the code explaining what needs to be connected.
Take a look at the "How It Works" section on this page. It explains each part of the expression in plain language so you can understand how everything works together.
Yes, absolutely. Most expressions include easy-to-edit variables near the top and comments that guide you on what to change. You can also link sliders or checkboxes using Expression Controls if you want more control in the timeline.
Yes, you can use it on any property with a stopwatch. That includes Position, Scale, Opacity, and also effect settings like Blur or Tint.
In most cases, yes. These expressions are designed to adapt to your comp’s resolution and frame rate. If anything specific needs adjusting, it’ll be noted in the code or in the "How It Works" section.
Explore more expressions in this category