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

Offset position over time

Community Beginner ,
Jan 27, 2023 Jan 27, 2023

Hi

I would like to move my layer 20 pixels up every 10 frames. How do I write the expression/script?

 

TOPICS
Expressions , How to
380
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

correct answers 1 Correct answer

Community Beginner , Jan 27, 2023 Jan 27, 2023

Hey Rick,

Thank you very much. It does work however it constantly moves up. I would like it to pause for 10 frames and then move up 20pixels, pause 10frames and then move up 20 pixels again

 

Translate
Community Expert ,
Jan 27, 2023 Jan 27, 2023
f =  (time - inPoint) / thisComp.frameDuration;
t = 10;
d = 20;
y = d/t * f;
[value[0], value[1] - y]

That should do it.

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 Beginner ,
Jan 27, 2023 Jan 27, 2023

Hey Rick,

Thank you very much. It does work however it constantly moves up. I would like it to pause for 10 frames and then move up 20pixels, pause 10frames and then move up 20 pixels again

 

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 ,
Jan 27, 2023 Jan 27, 2023
f =  (time - inPoint) / thisComp.frameDuration;
p = 10;// pause duration
d = 20;// move distance
y = Math.floor(f/p) * d;
[value[0], value[1] - y]
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 Beginner ,
Jan 31, 2023 Jan 31, 2023
LATEST

Perfect! thanks so much

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