ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Movement based on another layers position and offset by layers index?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Göran Thorén
Movement based on another layers position and offset by layers index?
on Jan 21, 2017 at 10:23:32 am

Hi expression magicians!
So.
What I'm trying to achieve is to move (or rotate) one layer and based on that movement, make a bunch of other layers move in the y axis in order based on their index.
Think of a line with little spheres and on top is a square moving from left to right and the spheres moves down when the square passes over, back to its origin after the square has passed.
Does this make sense? ☺

Any idea how such an expression would look like?

/Thank's in advance!



Return to posts index

Dan Ebberts
Re: Movement based on another layers position and offset by layers index?
on Jan 21, 2017 at 7:10:19 pm

Something like this maybe:

range = 150;
moveDist = 50;
d = length(thisComp.layer("square").transform.position,position);
yOffset = linear(d,0,range,moveDist,0);
value + [0,yOffset]


Dan



Return to posts index

Göran Thorén
Re: Movement based on another layers position and offset by layers index?
on Jan 23, 2017 at 12:13:50 pm

Wow! Thank's so much Dan!
Didn't get a notification about this so sorry for not thanking you earlier.

It works like a charm. Now I'm going to try to understand the expression. ☺
Thank's again!
/Göran



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]