Expression Library

Follow the Leader (for different start values)

Author: Dan Ebberts

This version of follow the leader is designed to work with follower layers that have starting values that differ from the leader layer. (The basic version of follow the leader will only work if the transform properties have the same starting value.) 

Code Sample

Hover over the code and click the copy button.

					L = thisComp.layer("leader");//replace "leader" with the name of your leader layer 
delay = 1.5; 
timeToStart = 0; 
myDelay = (index - L.index)*delay; 
t = time - (timeToStart + myDelay); 
if (t > 0){
    delta = L.transform.position.valueAtTime(t) - L.transform.position.valueAtTime(timeToStart); //remember to use the right transform property here   
    value + delta }
    else{   value }