3 Replies Latest reply on Oct 17, 2016 8:27 AM by Roei Tzoref

# Need help with an expression, please

Hey everybody!

I'm trying to accomplish something using an expression (pretty sure I can do what I'm trying to accomplish with one) but as I'm reading tutorials on expressions I'm having trouble wrapping my head around it.

What I'm trying to do is create an expression that will set the X position parameter of a layer to (960+(anchor point x value) of the same layer, while leaving Y alone.  I can't quite understand the context of how the expression code is being explained on the tutorials I'm reading.  Could someone who knows expressions give me an example of how to accomplish this, so I can try to pick apart the context and maybe do it myself next time?

Thank you!

Brique

• ###### 1. Re: Need help with an expression, please
I'm reading tutorials on expressions I'm having trouble wrapping my head around it.

use the adobe resources for starters. they will also refer to others.

After Effects expression examples

Learn expression basics to link animations in Adobe After Effects

What I'm trying to do is create an expression that will set the X position parameter of a layer to (960+(anchor point x value) of the same layer, while leaving Y alone.

open the expression for position. now you can put square brackets with values. for example [100,100] will set you position to 100,100.

you want the x to be 960+anchor point x value. so open brackets "[" and now type "960" and "+" and pick whip to the x anchor point. this is what you have so far:

[960+transform.anchorPoint[0]

you want the Y to remain the same so add the comma "," and now pick whip to the y rotation. and close brackets. finally you have this:

[960+transform.anchorPoint[0], transform.position[1]]

That's it.

3 people found this helpful
• ###### 2. Re: Need help with an expression, please

Thank you, Roei Tzoref, for the quick response, thank you for the links, and thank you most of all for the explanation!  Reading the breakdown in the direct context of what I was trying to accomplish helped a ton!

You Rock!

• ###### 3. Re: Need help with an expression, please

Thank you Brique Glad to help! I explain it like I get it!, and I am definitely not an expressionist so I try to make it simple.