View Full Version : expressions help

04 April 2005, 04:35 AM
Hi there

I am trying to get my head around expressions and have come up against a wall.

I want to animate the y position of one layer with the y position of another layer. For some reason you can't do this with the pick whip as it takes both the x and y position. I understand that layers positions x and y are defined by the numbers 0 and 1, but whenever I try to do this, I get an expression error. I just have no idea of the syntax needed to make this work and I have looked on line and can't find any tutorials for something so simple.

The reason I want to isolate the position is so I can make the other layer go in the opposite y direction.

AE 6.5.1



04 April 2005, 09:55 AM
You can do this with the pickwhip, just grab it on the Y value.

Ian Jones
04 April 2005, 10:53 AM
x = this.position[0];
y = thisComp.layer(1).position[1];

thisComp.layer( The index number goes here, or the layer name surrounded by " " );

position data is stored in an array, so position[0] gets the x, and position[1] gets the y.

[x,y]; just simply sets the final value, as the previous lines were just calculating and assigning to variables.

Ian Jones
04 April 2005, 10:54 AM
oh btw, there's an awesome expressions website at:

CGTalk Moderation
04 April 2005, 10:54 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.