Animate Text with Expression Selectors in After Effects

Expression Selectors in Adobe After Effects allow you to control individual characters, words, or lines programmatically rather than manually keyframing range boundaries. By combining text animators with dynamic code, you can produce complex procedural animations—such as organic wave motions, staggered offsets, and mathematical falloffs—without cluttering your timeline. This guide covers how to set up an Expression Selector, leverage core text variables, and apply practical expressions to animate individual characters.

Step 1: Add a Text Animator

  1. Create a new composition and add a text layer using the Type Tool (Ctrl+T or Cmd+T).
  2. Twirl open the text layer properties in the Timeline panel.
  3. Next to the Text property group, click the Animate pop-up menu and select the transform property you want to animate, such as Position, Scale, or Opacity.
  4. Set the value of the added animator property to the state you want characters to move toward or from (for example, set Position to 0, -100 to lift characters).

Step 2: Replace the Range Selector with an Expression Selector

By default, After Effects adds a standard Range Selector 1 to your animator.

  1. Twirl open Animator 1 and select Range Selector 1.
  2. Press Delete to remove it.
  3. Click the Add menu next to Animator 1, navigate to Selector, and choose Expression.

Step 3: Understand Expression Selector Logic

Twirl open Expression Selector 1 and expand the Amount property. The Expression Selector works by evaluating an expression on every character and calculating an amount between -100% and 100%. A value of 100% applies the animator property completely, while 0% leaves the character unchanged.

Two internal variables are essential when targeting individual characters:

  • textIndex: The sequential order of the current item (starting at 1).
  • textTotal: The total count of items in the layer.

Under the Expression Selector properties, ensure that Based On is set to Characters (you can also select Characters Excluding Spaces depending on your design).

Step 4: Write Expressions to Animate Characters

Alt-click (Windows) or Option-click (macOS) the stopwatch next to the Amount property within the Expression Selector to open the expression editor.

Example A: Staggered Sine Wave (Bouncing Characters)

To create an ongoing, flowing wave where each letter reacts sequentially based on time and its index:

freq = 3; // Waves per second
speed = 5; // Speed of movement
offset = textIndex * 0.5;
Math.sin(time * speed - offset) * 100;

Example B: Cascading Decay (Staggered Fall-In)

To animate each character smoothly into place sequentially using an index-based time delay:

delay = 0.08; // Time delay between each character
charTime = Math.max(0, time - (textIndex * delay));
easeOut = Math.exp(-charTime * 4);
easeOut * 100;

Example C: Random Character Wiggle

To apply an independent, organic jitter to each character without synchronized movement:

seedRandom(textIndex, true);
w = wiggle(3, 100);
w[0];

Step 5: Fine-Tune the Selector Settings

  1. Amount Units: Located in the selector properties, adjust whether values calculate as a Percentage or an absolute Index.
  2. Min/Max Mapping: If your code produces values outside of the normal range, you can combine positive and negative animator transforms to clamp or amplify the character offsets.
  3. Combine Multiple Animators: You can add secondary transform properties (such as Rotation or Tracking) into the same animator to have your expression drive multiple spatial attributes at once.