ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Have a layer follow a parented layer's Y position

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Stina Boberg
Have a layer follow a parented layer's Y position
on Jan 22, 2018 at 11:34:26 am

My setup is fairly simple. I've parented a null to the outer edge of a rotating gear, now I've got a different part of machinery that I would like to match this null's Y position, but not the X value. I've tried the code below and and while it matches the position perfectly I can't figure out how to use just one value and not both.

L = thisComp.layer("Look at");
L.toWorld(L.anchorPoint)


Return to posts index

Dan Ebberts
Re: Have a layer follow a parented layer's Y position
on Jan 22, 2018 at 4:31:13 pm

Try this:

L = thisComp.layer("Look at");
[value[0],L.toWorld(L.anchorPoint)]


Dan



Return to posts index

Stina Boberg
Re: Have a layer follow a parented layer's Y position
on Jan 23, 2018 at 10:23:30 am

Thank you for the reply! I tried it, and it throws this error:

Error at line 0. Array piece can't expand to more than one value.

I'm having trouble wrapping my head around toWorld, any ideas for how to work around this?


Return to posts index


Stina Boberg
Re: Have a layer follow a parented layer's Y position
on Jan 23, 2018 at 10:29:00 am

Managed to solve it myself by adding a [1] at the end! Thank you for the help. :)


Return to posts index

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