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.

  1. Select the layer you want to wiggle and hit P on your keyboard to open the position property.
  2. Hold ALT on your keyboard and click on the stopwatch icon.
  3. 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