Skip to main content
Participant
April 11, 2024
Question

move position every frame

  • April 11, 2024
  • 1 reply
  • 348 views

I'm looking for a script that will move position for a set amount per frame. For example, I'd like to move the y position by 45 units every frame...

This topic has been closed for replies.

1 reply

Mylenium
Legend
April 11, 2024
DustyDeenAuthor
Participant
April 11, 2024

I think I misspoke. I'm not seeing how this script would do what I need. I'm actually looking for an expression that will move the position a set amount of pixels every frame. For example add 45 pixels to the position on every frame. So, if frame 1=0, frame 2=45, frame 3=90, frame 4=135 and so on. Hopefully a way to do this without keyframes?

Dan Ebberts
Community Expert
Community Expert
April 11, 2024

Maybe a position expression like this:

y = timeToFrames(time)*45;
[value[0],y]

or like this to start at the layer's original position:

yOffset = timeToFrames(time)*45;
value + [0,yOffset]