ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Point one layer at another

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Joseph Bauer
Point one layer at another
on Mar 22, 2019 at 4:54:11 am

I need Null 1 to always point at Null 2.
So an expression to control its rotation I guess.

I've searched for about an hour and can't find the answer, or the answers given don't actually work. Thanks in advance for any help.


Return to posts index

Dan Ebberts
Re: Point one layer at another
on Mar 22, 2019 at 6:37:14 am

2D? Something like this:

p2 = thisComp.layer("Null 2").toComp([0,0]);
p1 = toComp(anchorPoint);
v = p2-p1;
radiansToDegrees(Math.atan2(v[1],v[0]))


Dan



Return to posts index

Joseph Bauer
Re: Point one layer at another
on Mar 22, 2019 at 12:11:26 pm

It worked!

Thank you so much, Dan


Return to posts index

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