ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Move layer x pixels every nn frames

FAQ   •   VIEW ALL Move layer x pixels every nn frames on Jan 20, 2016 at 11:04:55 pm

would like to move my layer's position by an artbitrary amount of pixels in +x direction in a certain period of time.

Ideally, it would go something like this: Every half second, add nn to the x position of a layer using hold interpolation.

Or every 12 frames, jump the position xx pixels to the right.

So there would be a continuous progressive jumpy scroll to the right. Re: Move layer x pixels every nn frameson Jan 20, 2016 at 11:25:03 pm

This should work:

tStep = framesToTime(12);
jumpX = 10;
nSteps = Math.floor((time-inPoint)/tStep);
value + [nSteps*jumpX,0]

Dan Re: Move layer x pixels every nn frameson Jul 31, 2016 at 6:10:20 pm

Maybe like this:

tStep = framesToTime(12);
jumpX = 10;
t = time - inPoint;
nSteps = Math.floor(t/tStep);
phase = t-(tStep*nSteps);
e = ease(phase,0,tStep,0,jumpX);
value + [nSteps*jumpX + e,0]

Dan Re: Move layer x pixels every nn frameson May 22, 2020 at 5:35:50 pm

Like this maybe:

``` tStep = framesToTime(12); tPause = framesToTime(10); jumpX = 10; t = time - inPoint; nSteps = Math.floor(t/(tStep+tPause)); phase = t-((tStep+tPause)*nSteps); e = ease(phase,0,tStep,0,jumpX); value + [nSteps*jumpX + e,0] ```

Dan