Skip to main content
April 1, 2010
Answered

follow a leader with delay

  • April 1, 2010
  • 1 reply
  • 2994 views

hi

i have bunch of layers all distributed in z space.All in a row.So,they have all differenent position data.

Now the first layer starts to move towards the camera.After a specific time i.e 1.5 secs i want to move the second layer to move with the first one.etc.

thisComp.layer(thisLayer,-1).position.valueAtTime() doesn't work.

something similar to this>

start = 0; //start time of template motion
end = 4.0; //end time of template motion

t = thisComp.layer("template");
offset = (t.effect("offset")("Slider")/100)*(index -1);
travel = linear(t.effect("travel")("Slider")/100,start,end);
t.position.valueAtTime(travel - offset)

any ideas?

cheers

This topic has been closed for replies.
Correct answer Dan Ebberts

Try this and see if it's close:

L = thisComp.layer("leader");
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);
  value + delta
}else{
  value
}

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
April 1, 2010

Try this and see if it's close:

L = thisComp.layer("leader");
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);
  value + delta
}else{
  value
}

Dan

April 7, 2010

cheers it works