-
Throw expression, but only for a set distance
I have to set up a ton of little tiny squares that move 10 pixels up in a semi-random order.
Right now I’m using two position keyframes… which works. But it’s kind of a hassle to make sure both keyframes are selected if I need to reposition them around the screen.
I ran into this “Throw” expression that moves a layer in one direction (left) into infinity.
// Throw (move at a constant speed without keyframes)
veloc = -10; //horizontal velocity (pixels per second)
x = position[0] + (time – inPoint) *veloc;
y = position[1];
[x,y]Is there a way to make it stop moving after a certain pixel distance? So I can place a square anywhere and it’ll move 10 pixels up beginning at its inPoint without any keyframes?
EDIT: on second look, this expression doesn’t seem to work either. Syntax error in line 3?