How to Wiggle Position Without Affecting Z in After Effects
Applying the wiggle expression to a 3D layer in Adobe After Effects usually shifts the layer across the X, Y, and Z axes simultaneously, causing unintended depth movement. This guide explains how to isolate the wiggle effect exclusively to the X and Y dimensions while keeping the Z-axis locked in place, using both a straightforward expression method and the Separate Dimensions technique.
The Expression Method
By default, applying wiggle(frequency, amplitude) to a
3D layer outputs a three-dimensional array [x, y, z]. To
prevent the layer from moving forward or backward in 3D space, you must
capture the wiggle values for X and Y while passing the layer’s
original, un-wiggled value to Z.
- Select your 3D layer in the timeline and press P to reveal the Position property.
- Hold Alt (Windows) or Option (macOS) and click the stopwatch icon next to Position to open the expression editor.
- Paste the following expression:
w = wiggle(3, 50);
[w[0], w[1], value[2]];- Click outside the text box to apply the expression.
How It Works
w = wiggle(3, 50);calculates a wiggle occurring 3 times per second with a range of 50 pixels.w[0]extracts only the calculated X-axis wiggle.w[1]extracts only the calculated Y-axis wiggle.value[2]references the layer’s native Z-axis position value, leaving its depth completely unaffected by the wiggle.
The Separate Dimensions Method
If you prefer not to write an array-based expression, you can separate the spatial dimensions directly within After Effects:
Select your 3D layer and press P to reveal Position.
Right-click on the word Position and choose Separate Dimensions.
The property will split into X Position, Y Position, and Z Position.
Hold Alt / Option and click the stopwatch on X Position, then enter:
wiggle(3, 50);Repeat the process for Y Position.
Leave Z Position empty to maintain your original depth position without movement.