In After Effects, I want to have a layer (let's call it Leader
) that moves and another one (let's say Follower
) that is linked to the first one, so it will have the same movement, but at a specific time (t
) it should "unlink" from the first layer and stay in that position. I have tried the following:
p = thisComp.layer("Leader").transform.position;
t = 1; // Stop following after 1 second
if (time <= t) {
position = value + (p.value - p.valueAtTime(0));
}
else {
valueAtTime(t - thisComp.frameDuration);
}
But for some reason I don't understand, at time t
, the Follower
goes back to its original position instead of staying in the place in which it was "unlinked" from the Leader
. What am I missing?