3 people found this helpful
If you are playing with lookAt and 3D layers then this will work:
if applied to the layer's orientation and your null is named "leader'
It will take some figuring on my part to make looAt work with 2D layers.
I would suggest you take a look at Dan Ebberts motion script site -- especially these pages:
The last link is probably a start at what you want. If your null was named leader the expression you would start with would look like this:
L = thisComp.layer("leader");
u = L.toWorldVec([1,0]);
But if that is not what you need please include a detailed description and/or copy and paste a full resolution screenshot in the reply field on the forum so we can better help you find a solution.
Finally had a moment
If your null is named leader then this expression will always point a layer at the null.
this_point = thisComp.layer("leader").position;
that_point = position;
ang = radians_to_degrees(angle);
Thank you so much Rick. You nailed it.
With a little more work on the basic idea you could define a radius of influence so the pull of the layers toward the follow null was proportional. You would do that by using the length method and set up a multiplier based on the distance so if the leader was more than something like 300 pixels there would be no influence on the angle but as it moved closer to the layer the attraction to the leader would increase so it would point directly at the leader if the distance was less than 200 pixels. It's all basic math. I'll leave you to figure that one out.