Skip to main content
Participant
January 27, 2023
解決済み

Offset position over time

  • January 27, 2023
  • 返信数 1.
  • 514 ビュー

Hi

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

 

このトピックへの返信は締め切られました。
解決に役立った回答 Strange25802832ihxw

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

 

返信数 1

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

That should do it.

Strange25802832ihxw作成者解決!
Participant
January 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

 

Community Expert
January 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]