How to Use Time Expressions in After Effects

This article provides a straightforward guide to creating continuous, keyframe-free animations in Adobe After Effects using basic time-based expressions. You will learn the fundamental role of the time variable, how to apply it to layer properties, and how to scale its speed using simple math operators for properties like Rotation, Opacity, and Position.

Understanding the time Variable

In Adobe After Effects, the word time represents the current playback position of the timeline measured in seconds. At zero seconds, time equals 0. At two seconds, time equals 2. When applied to a property, the value automatically updates along with the timeline, removing the need to manually set keyframes.

Applying a Basic Time Expression

To add a basic time expression to any property:

  1. Select the layer in your timeline and press the keyboard shortcut for the desired property (e.g., R for Rotation, P for Position, or T for Opacity).

  2. Hold Alt (Windows) or Option (macOS) and click the stopwatch icon next to the property name.

  3. In the text field that appears in the timeline, delete any existing text and type:

    time;
  4. Click anywhere outside the text box or press the numeric keypad Enter to commit the expression.

Controlling the Speed

Using time alone usually results in changes that are too slow. For instance, applying time to Rotation means the layer rotates only 1 degree per second. To speed up or slow down the animation, multiply or divide the time variable using standard mathematical operators.

  • Multiply (faster): To make a layer rotate 180 degrees every second, enter:

    time * 180;
  • Negative Values (reverse): To reverse the direction of rotation, multiply by a negative number:

    time * -180;
  • Division (slower): For subtle changes, such as a slow opacity fade, divide time:

    time / 2;

Using Time with Multi-Dimensional Properties

Properties like Position and Scale contain two or three dimensions (X, Y, and Z) represented as arrays. To drive only one axis with the time expression while keeping the other fixed, write the expression in brackets.

To animate an object moving horizontally along the X-axis by 100 pixels per second while keeping its current Y-position, apply this expression to the Position property:

[value[0] + (time * 100), value[1]];
  • value[0] preserves the layer’s original X position.
  • value[1] preserves the layer’s original Y position.