Copy link to clipboard
Copied
Hi everyone,
I have three keyframes on the Position property of an object. I want the third keyframe to automatically move the object by the same amount of distance as the movement between the first and the second keyframe.
Is there a way to automate this using expressions or another method, so I don’t have to calculate and input the values manually?
Thanks in advance!
Copy link to clipboard
Copied
I can think of a couple of ways to do it. This should work:
v = value;
if (numKeys > 2){
t1 = key(1).time;
t2 = key(2).time;
t3 = key(3).time;
if (time > t2){
t = linear(time,t2,t3,t1,t2);
v = valueAtTime(t2) + (valueAtTime(t) - valueAtTime(t1));
}
}
v
Find more inspiration, events, and resources on the new Adobe Community
Explore Now