With a few lines of additional code to the standard wiggle expression, we can start and stop wiggle effect in After Effects at a specific time.
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 the 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 every 20 frames interval.
But what if we want to start or stop the layer to wiggle at a specific time? With a 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 the below codes to start and stop the wiggle effect at a specific time.
Apply the following expression to wiggle it beginning at a time of 5 seconds:
timeToStart = 5; if (time > timeToStart) { wiggle(10,20); } else { value; }
Use the following expression to a property to stop wiggling it at a time of 10 seconds:
timeToStop = 10; if (time > timeToStop) { value; } else { wiggle(10,20); }
Apply the following expression to a property to start wiggling it at a time of 5 seconds and stop wiggling it at a time of 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.
Also, check out: 10 Best Websites/Resources To Learn After Effects Expressions
HI there, this is very helpful thank you very much. I have followed your last code (Start/Stop)
How would you modify this so that when it starts the wiggle expression (in my case 1 sec) it transitions smoothly from the non-wiggle state to the wiggle state. At the moment I have a clearly noticeable jump.
I am wiggling the scale , rotation and position parameters very slightly from sec 1 until sec 28 in a 30sec clip. Appreciate some help
thanks
expression is working right
but this stops suddenly which makes a glitch effect.
is there any expression that stops wiggle in a smooth way?
awesome! THX but… the wiggle stops very noticeably. Just jumping to its starting point. Would be nice when the movement would move back to this place and not jump there. I will try if a slider to control the intensity of the wiggle is more useful to kinda keyframe that.
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
copy and paste it exactly in the expression area (do not type wiggle first) just paste this code into the time line with nothing else