15 Essential After Effects Expressions

Mark Roberts By Mark Roberts April 6, 2025
15 Essential After Effects Expressions

15 Essential After Effects Expressions That Will Transform Your Animation Workflow

After spending over a decade working with After Effects on commercial projects, I can confidently say that expressions are what separate the professionals from the amateurs. While keyframes are the foundation of animation, expressions are the secret weapon that can save you hours of tedious work and elevate your animations to a new level.

In this guide, I’ll share the 15 most practical After Effects expressions I use in my daily workflow, with special attention to the incredibly versatile bounce expressions that clients constantly request. I’ve included copy-paste ready code, real-world examples, and explanations in plain English – no computer science degree required.

Why Every Motion Designer Should Master Expressions

Before diving into the code, let’s address why expressions matter. In my early career, I avoided expressions because they seemed intimidating. That avoidance cost me hundreds of hours of manual keyframing that could have been automated.

The turning point came when a client requested last-minute changes to a 60-second animation with dozens of animated elements. What would have taken days to adjust manually took just minutes with expressions. Since then, I’ve never looked back.

Expressions aren’t just for complex projects – they’re workflow enhancers that:

  • Automate repetitive animations
  • Create organic, physics-based movements
  • Allow for dynamic and responsive animations
  • Make project revisions infinitely easier

Now, let’s get to the expressions you’ll actually use.

1. The Ultimate Inertial Bounce Expression

The bounce expression is the crown jewel in any motion designer’s toolkit. It creates natural, physics-based bouncing that would be nearly impossible to keyframe manually.

I recently used this on a product launch video where the client wanted logo elements to “drop in” with a realistic bounce. The result was so natural that viewers assumed we’d used a 3D physics engine.

Here’s the code I use most frequently:


// Inertial Bounce Expression
// Apply to position, scale, rotation or other properties

amp = 0.1;     // Amplitude (higher = bigger bounce)
freq = 2.0;    // Frequency (higher = faster bounce)
decay = 2.0;   // Decay (higher = quicker settling)
n = 0;
time_max = 4;  // Maximum time to calculate (in seconds)

if (numKeys > 0) {
  n = nearestKey(time).index;
  if (key(n).time > time) {
    n--;
  }
}

if (n == 0) { 
  t = 0;
} else {
  t = time - key(n).time;
}

if (n > 0 && t < time_max) {
  v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
  value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
} else {
  value
}

How to Use the Inertial Bounce Expression:

  1. Create two keyframes where you want the bounce to occur
  2. Copy the expression above
  3. Select the property you want to animate (position, scale, rotation, etc.)
  4. Press Alt+Click (Windows) or Option+Click (Mac) on the stopwatch icon
  5. Paste the expression
  6. Adjust the amp, freq, and decay variables to fine-tune your bounce

The beauty of this expression is its versatility. It works on almost any property – position for bouncing objects, scale for squash and stretch effects, or rotation for pendulum movements.

Pro Tip: For a more dramatic bounce, increase the amp value. For a quicker bounce, increase the freq value. To make the bounce settle faster, increase the decay value.

2. Enhanced Bounce Expression with Direction Control

Sometimes you need more control over which direction the bounce happens. This enhanced version lets you specify which dimensions should bounce:


// Directional Bounce Expression
// Apply to position for controlled bounce

amp = 0.1;          // Amplitude
freq = 2.0;         // Frequency
decay = 2.0;        // Decay
n = 0;
time_max = 4;
bounceX = true;     // Set to false to prevent X-axis bounce
bounceY = true;     // Set to false to prevent Y-axis bounce
bounceZ = false;    // Set to false to prevent Z-axis bounce (for 3D layers)

if (numKeys > 0) {
  n = nearestKey(time).index;
  if (key(n).time > time) n--;
}

if (n == 0) {
  t = 0;
} else {
  t = time - key(n).time;
}

if (n > 0 && t < time_max) {
  v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

  // Create bounce vector based on direction booleans
  bounceVector = [
    bounceX ? v[0]*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t) : 0,
    bounceY ? v[1]*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t) : 0,
    bounceZ && v.length > 2 ? v[2]*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t) : 0
  ];

  value + bounceVector;
} else {
  value
}

This is particularly useful for user interface animations where you might want elements to bounce in one direction only, like a sidebar that only bounces horizontally.

3. Text Bounce Expression

Text animations often need special attention. This expression creates a delightful bouncing effect specifically for text layers:


// Text Bounce Expression
// Apply to text scale

scale_amp = 0.3;    // Scale amplitude
freq = 3.0;         // Frequency
decay = 4.0;        // Decay rate
overshoot = 1.1;    // Maximum scale (1.1 = 110%)
duration = 0.5;     // Duration of bounce effect (in seconds)

t = time - inPoint;

if (t < 0) {
  [0,0]  // Hide text before in-point
} else if (t < duration) {
  s = overshoot - scale_amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);
  [s*100, s*100]
} else {
  [100,100]  // Return to 100% scale after duration
}

I used this expression on a recent explainer video where keywords needed to pop with emphasis. The client loved how the text seemed to “land” with impact without being distracting.

4. Bounce-Back Expression

This expression creates a “rubber band” effect where an object overshoots its destination and snaps back:


// Bounce-Back Expression
// Apply to position, scale, or rotation

elasticity = 2;     // Higher values = more elastic
damping = 6;        // Higher values = faster settling
duration = 1;       // Duration in seconds

t = time - inPoint;
if (t < 0) {
  startValue
} else if (t < duration) {
  progress = t / duration;
  easedProgress = progress * (1 - Math.exp(-damping * progress));

  // Oscillation that decreases over time
  oscillation = Math.sin(elasticity * Math.PI * progress) * (1 - progress);

  finalProgress = easedProgress + oscillation * (1 - easedProgress);

  startValue + (endValue - startValue) * finalProgress;
} else {
  endValue
}

To use this expression, you’ll need to define startValue and endValue variables at the beginning of the expression with the values you want to animate between.

5. Drop and Bounce Expression

This expression simulates an object dropping and bouncing, perfect for logos or elements entering a scene:


// Drop and Bounce Expression
// Apply to position (Y-axis)

startY = -200;       // Starting Y position (above frame)
endY = value[1];     // Final resting Y position
gravity = 3000;      // Higher values = faster drop
elasticity = 0.7;    // 0-1, higher values = bouncier
friction = 0.7;      // 0-1, higher values = faster settling

// Time since object started falling
t = time - inPoint;
if (t < 0) return [value[0], startY];

// Calculate initial velocity needed for the drop
initialVelocity = -Math.sqrt(2 * gravity * Math.abs(startY - endY));

// Apply physics
currentPos = startY + initialVelocity * t + 0.5 * gravity * t * t;
currentVel = initialVelocity + gravity * t;

// Handle bouncing
numBounces = 0;
bounceTime = 0;
bouncePos = currentPos;
bounceVel = currentVel;

// Simulate bounces
while (bouncePos > endY && numBounces < 10) {
  // Time to hit ground
  tHit = bounceTime + (-bounceVel + Math.sqrt(bounceVel * bounceVel - 2 * gravity * (bouncePos - endY))) / gravity;

  if (t < tHit) break;

  // Bounce occurs
  numBounces++;
  bounceTime = tHit;
  bouncePos = endY;
  bounceVel = -bounceVel * elasticity * Math.pow(friction, numBounces - 1);

  // Calculate position after bounce
  deltaT = t - bounceTime;
  bouncePos = endY + bounceVel * deltaT + 0.5 * gravity * deltaT * deltaT;
  bounceVel = bounceVel + gravity * deltaT;
}

// Return final position
[value[0], Math.min(bouncePos, endY)];

This physics-based expression creates incredibly realistic bouncing for elements dropping into the frame.

6. Elastic Text Animation Expression

This expression creates an elastic effect for text animation where each character bounces individually:


// Elastic Text Animation Expression
// Apply to text animator > Position or Scale

amt = 100;          // Amount of movement/scale
elasticity = 3;     // Bounciness (higher = more bounces)
duration = 1;       // Animation duration in seconds
delay = 0.05;       // Delay between characters

t = time - inPoint - (delay * textIndex);

if (t < 0) {
  0
} else if (t < duration) {
  progress = t / duration;
  easeProgress = progress * progress * (3.0 - 2.0 * progress);  // Smoothstep
  elastic = Math.sin(elasticity * Math.PI * progress) * Math.pow(1 - progress, 2);

  amt * (easeProgress + elastic * 0.5)
} else {
  amt
}

To use this expression, create a text animator and apply it to the Position or Scale property of the text.

7. Auto-Bounce on Layer Start

This expression automatically creates a bounce whenever a layer appears:


// Auto-Bounce on Layer Start
// Apply to Scale

bounceAmount = 0.3;  // How much overshoot (0.3 = 30%)
freq = 2;           // Frequency of bounce
decay = 8;          // How quickly bounce settles
duration = 0.5;     // Duration of bounce effect

t = time - inPoint;

if (t <= 0) {
  [0,0]  // Hide before in-point
} else if (t < duration) {
  baseScale = 100;
  overshoot = baseScale * (1 + bounceAmount);
  currentScale = overshoot - (overshoot - baseScale) * (1 - Math.sin(freq * Math.PI * t) / Math.exp(decay * t));
  [currentScale, currentScale]
} else {
  [100,100]  // Normal scale after effect
}

I use this frequently for UI animations where elements need to enter with energy but shouldn’t distract from the content.

8. Wiggle with Bounce Expression

This combines the popular wiggle expression with bounce physics for a more organic random movement:


// Wiggle with Bounce Expression
// Apply to position or rotation

freq = 2;         // Wiggle frequency
amp = 10;         // Wiggle amplitude
bounce_freq = 3;  // Bounce frequency
bounce_amp = 0.5; // Bounce amplitude
decay = 5;        // Bounce decay

// Generate wiggle
w = wiggle(freq, amp);

// Add bounce to wiggle
t = time - inPoint;
bounce = bounce_amp * Math.sin(bounce_freq * 2 * Math.PI * t) / Math.exp(decay * t);

value + w * (1 + bounce);

This creates a wonderfully organic movement that feels alive rather than mechanical.

9. Smooth Bounce Expression

This is a gentler version of the bounce effect, perfect for more subtle animations:


// Smooth Bounce Expression
// Apply to position, scale, or rotation

amplitude = 20;     // Height of bounce
frequency = 3;      // Number of bounces
decay = 5;          // Speed of decay (higher = faster)
t = time - inPoint;

if (t <= 0) {
  value
} else {
  baseValue = value;
  baseValue + amplitude * Math.sin(frequency * Math.PI * t) * Math.exp(-decay * t);
}

10. Advanced Spring Physics Expression

For more complex bouncing that simulates true spring physics:


// Spring Physics Expression
// Apply to position

stiffness = 5;     // Higher = more rigid spring
damping = 0.7;     // Higher = less oscillation
mass = 1;          // Higher = more inertia
restPos = value;   // Rest position of spring

// Get velocity
if (numKeys > 0) {
  n = nearestKey(time).index;
  if (key(n).time > time) {
    n--;
  }
  if (n > 0) {
    t1 = key(n).time;
    t2 = key(n+1).time;
    v1 = velocityAtTime(t1);
    v2 = velocityAtTime(Math.min(time, t2));
    velocity = v2;
  } else {
    velocity = [0,0,0];
  }
} else {
  velocity = [0,0,0];
}

// Calculate spring force
force = stiffness * (restPos - value);

// Apply damping
dampingForce = -damping * velocity;

// Calculate acceleration
acceleration = (force + dampingForce) / mass;

// Update position using verlet integration
value + velocity * thisComp.frameDuration + 0.5 * acceleration * thisComp.frameDuration * thisComp.frameDuration;

This expression creates incredibly realistic spring physics that respond naturally to any keyframe changes.

11. Bounce Scale with Squash and Stretch

This expression adds cartoon-like squash and stretch to make bouncing elements feel more lively:


// Bounce Scale with Squash and Stretch
// Apply to scale

amp = 0.2;        // Bounce amplitude
freq = 2.5;       // Bounce frequency
decay = 3.0;      // Decay rate
squash = 0.3;     // Squash amount (higher = more squash)
n = 0;
time_max = 3;

if (numKeys > 0) {
  n = nearestKey(time).index;
  if (key(n).time > time) n--;
}

if (n == 0) {
  t = 0;
} else {
  t = time - key(n).time;
}

if (n > 0 && t < time_max) {
  v = velocityAtTime(key(n).time - thisComp.frameDuration/10);

  // Calculate bounce amount
  bounce = amp * Math.sin(freq * t * 2 * Math.PI) / Math.exp(decay * t);

  // Create squash and stretch effect based on velocity direction
  vLen = length(v);
  vNorm = (vLen > 0) ? normalize(v) : [0,0,0];

  // Apply different scale to X and Y based on velocity direction
  squashX = 1 - (vNorm[0] * vNorm[0] * bounce * squash);
  squashY = 1 - (vNorm[1] * vNorm[1] * bounce * squash);

  // Apply scale changes
  [value[0] * squashX, value[1] * squashY]
} else {
  value
}

This expression is particularly effective for character animation or cartoon-style projects.

12. One-Line Bounce Expression (Simplified Version)

For quick implementations, this simplified bounce is perfect:


// Simple Bounce Expression
// Apply to any property

value + velocity * 0.05 * Math.sin(time * 8) / Math.pow(time - key(1).time + 0.1, 0.5)

This simplified version works best when you need a quick bounce effect but don’t need precise control over the physics.

13. Bounce to Specific Value Expression

This expression lets you define a starting and ending value with bounce:


// Bounce to Value Expression
// Apply to any property

startValue = 0;    // Starting value
endValue = 100;    // Target value
duration = 1;      // Duration in seconds
elasticity = 2;    // Bounciness
decay = 5;         // How quickly bounce settles

t = time - inPoint;
progress = Math.min(t / duration, 1);

// Smooth progress with bounce
if (progress < 1) {
  elastic = Math.sin(elasticity * Math.PI * progress) * Math.exp(-decay * progress);
  progress = progress + elastic * (1 - progress);
}

startValue + (endValue - startValue) * progress;

This is great for animated sliders, progress bars, or any animation where you need to move between specific values.

14. Continuous Bounce Expression

Need something to bounce forever? This expression creates a perpetual bounce:


// Continuous Bounce Expression
// Apply to position, scale, or rotation

amp = 20;         // Amplitude
freq = 3;         // Frequency
decay = 0.5;      // Lower values make bounce last longer
t = time - inPoint;

baseValue = value;
offset = amp * Math.sin(freq * Math.PI * t) * Math.exp(-decay * t % 2);

// For position properties, apply to just Y axis
if (value instanceof Array && value.length > 1) {
  [baseValue[0], baseValue[1] + offset]
} else {
  baseValue + offset
}

I’ve used this for background elements that need constant subtle animation to keep scenes feeling alive.

15. Exponential Bounce Expression

This expression creates a bounce that gets progressively smaller, perfect for simulating realistic physics:


// Exponential Bounce Expression
// Apply to position (Y-axis)

startY = value[1] - 200;  // Starting position
endY = value[1];          // Final position
bounceHeight = 100;       // Initial bounce height
elasticity = 0.6;         // 0-1, higher values = bouncier

t = time - inPoint;
gravity = 1000;           // Gravity strength

// Calculate time for each bounce
bounceTime = Math.sqrt(2 * bounceHeight / gravity) * 2;
currentBounce = Math.floor(t / bounceTime);
currentBounceTime = t % bounceTime;
totalBounces = 10;        // Maximum number of bounces to calculate

if (currentBounce >= totalBounces) {
  // Animation complete
  [value[0], endY];
} else {
  // Calculate current bounce height
  currentHeight = bounceHeight * Math.pow(elasticity, currentBounce);

  // Calculate position within current bounce
  halfBounce = bounceTime / 2;
  if (currentBounceTime < halfBounce) {
    // Going up
    progress = currentBounceTime / halfBounce;
    height = currentHeight * Math.sin(progress * Math.PI/2);
  } else {
    // Coming down
    progress = (currentBounceTime - halfBounce) / halfBounce;
    height = currentHeight * Math.cos(progress * Math.PI/2);
  }

  // Return position
  [value[0], endY - height];
}

How to Modify Bounce Expressions for Your Needs

The beauty of these expressions is their adaptability. Here are some tips for customizing them:

  • Amplitude (amp): Controls the “height” of the bounce. Increase for more dramatic bounces.
  • Frequency (freq): Controls how quickly the bounce oscillates. Higher values create faster, tighter bounces.
  • Decay: Controls how quickly the bounce settles. Higher values make the bounce stop sooner.
  • Direction Control: For position bounces, you can make them only affect certain dimensions by modifying the returned value array.

Real-World Applications for Bounce Expressions

I’ve used these expressions in various professional contexts:

  • Logo Animations: Making logos bounce into frame creates a playful yet professional entrance.
  • UI/UX Animations: Subtle bounces give digital interfaces a tactile, satisfying feel.
  • Character Animation: Using bounce expressions for overlapping action creates more lifelike movements.
  • Text Animation: Bouncing text characters individually creates readable yet dynamic typography.
  • Infographics: Data elements that bounce into place draw attention to key statistics.

Troubleshooting Common Issues

If your bounce expressions aren’t working correctly, check these common issues:

  • Expression Applied to Wrong Property: Ensure you’re applying the expression to the property you want to animate.
  • Missing Keyframes: Most bounce expressions work by calculating velocity between keyframes, so make sure you have at least two keyframes set.
  • Values Too Extreme: If your animation looks crazy, try reducing the amplitude or frequency values.
  • No Effect Visible: The expression might be working, but the effect is too subtle. Try increasing the amplitude.

Beyond the Bounce: Combining Expressions for Complex Animations

The true power of expressions emerges when you combine them. For example:

  • Add wiggle to your bounce for organic movement
  • Combine bounce with follow-through expressions for secondary animation
  • Use time remapping with bounce for dynamic speed changes

Conclusion: The Impact of Mastering Expressions

Learning to use these expressions effectively will transform your animation workflow. I’ve seen junior animators become team leaders simply because they could implement complex animations efficiently using expressions.

Mark Roberts

About the Author

Mark Roberts is a content creator at Bentomotion, specializing in motion graphics templates and tutorials.

Comments

Loading comments...