Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save howiemnet/8b0099619b35fcbfeba53a540c440c2b to your computer and use it in GitHub Desktop.
Save howiemnet/8b0099619b35fcbfeba53a540c440c2b to your computer and use it in GitHub Desktop.
C = thisComp.layer("Camera");
V = C.toWorldVec([0,0,1]);
P = toWorld(anchorPoint);
lookAt(P, P + V);
@howiemnet
Copy link
Author

This makes a layer (usually a null, or a text layer etc) face the camera by orienting it to match the camera's orientation in world space. This differs from the built-in "Look At Camera" function, which points a layer's Z axis at the camera's position. The difference is that objects that aren't perfectly central in the frame tend to tilt inwards a little with the built-in function; the code above keeps text [etc] perfectly straight, perfectly in line with the frame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment