Wiggle (camera shake) is one of the most common, easy to remember After Effects expression and is applied to the position property of a layer. wiggle(x,y) where x and y are in digits, x stands for a number of times you want the layer to wiggle and y stands for the number of frames in which you want that layer to move.
Adding the expression wiggle(10,20) to the position property of a layer will randomly wiggle it 10 times in every 20 frames interval.
But what if we want to start or stop the layer to wiggle at a specific time. With few lines of code, we can begin and end the influence of the wiggle expression at a specific time.

To begin with, we need to apply the wiggle expression to the position property of the layer.
- Select the layer you want to wiggle and hit P on your keyboard to open the position property.
- Hold ALT on your keyboard and click on the stopwatch icon.
- Delete transform.position from the text area and type in the wiggle expression.
Here comes the fun part, the basic wiggle expression will wiggle the layer for the entire duration. Update the expression with below codes to start and stop the wiggle effect at a specific time.
Apply the following expression to wiggle it beginning at time 5 seconds:
timeToStart = 5; if (time > timeToStart) { wiggle(10,20); } else { value; }
Apply the following expression to a property to stop wiggling it at time 10 seconds:
timeToStop = 10; if (time > timeToStop) { value; } else { wiggle(10,20); }
Apply the following expression to a property to start wiggling it at time 5 seconds and stop wiggling it at time 10 seconds:
timeToStart = 5; timeToStop = 10; if ((time > timeToStart) && (time < timeToStop)) { wiggle(10,20); } else { value; }
Make sure you use the expression in the correct format and double check the parentheses.
THANK YOU !!!!
Most Welcome!
This was great. But I got stuck on creating a 2nd wiggle further down the timeline.
Here’s my solution, pay attention to the logic in the if clause.
shake1Start = 2.15;
shake1Stop = 2.25;
shake2Start = 2.85;
shake2Stop = 2.95;
if ((time > shake2Start) && (time shake1Start) && (time < shake1Stop)) {
wiggle(10,10);
} else {
value;
}
Hi Michael, Thanks a lot for sharing this. Will try it out as well.
Is there anyway for the wiggle to start in a position and end in a different random position?
I’m trying to make a lottery type of list to select a winner and am using Y axis wiggle with the expression you provided in the article. but when the wiggle stops, it’s the same place (name) that it started.
Raunak, thanks for this info and tutorial!
But I’m afraid it isn’t working for me. I’m new to after effects, do you have a screencapture of the expression applied in AE?
Thank you very much