Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to apply the same movement from Keyframe 1–2 to Keyframe 2–3 (automatically)?

New Here ,
Apr 14, 2025 Apr 14, 2025

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!

TOPICS
Expressions , FAQ
110
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 15, 2025 Apr 15, 2025
LATEST

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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines