Overlapping Action

Secondary properties follow the primary animation with natural offset and overlap.

Expression Code

// Overlapping Action
// Apply to Rotation (or Scale)
// Layer should have Position keyframes

overlap = 5;      // Amount of overlap (degrees for Rotation)
smoothing = 0.2;  // Smoothing (seconds)
axis = "x";       // "x" or "y" — which axis drives the overlap

vel = thisLayer.position.velocityAtTime(time);
prevVel = thisLayer.position.velocityAtTime(time - smoothing);

if (axis == "x") {
  v = (vel[0] + prevVel[0]) / 2;
} else {
  v = (vel[1] + prevVel[1]) / 2;
}

value - v / 100 * overlap;
Apply to Rotation on a layer that has Position keyframes. The layer tilts in the direction of movement — like a character leaning forward when running. Adjust overlap for intensity.