After Effects Expression/Script?

Is there an expression or script in After Effects that can make a null object always face a camera?

I believe that it can be done, if that is what you need, just make Camera to be a Parent to Null Object

Right click Null or 3d layer/transform/Auto-Orient/Orient Towards Camera

Kramz’ method will work fine.

If you need to do it with expressions, then…

cam = thisComp.layer("Camera 1"); //put your camera name here
lookAt(this.position, cam.position);

…on the orientation property of your layer.

Neither of these ‘look at’ methods use a specific ‘up vector’. The way the layer is rotated around the Z axis that faces the camera may be unpredictable. If you need to use an up vector, then you need a much longer expression.

-felt.

Thanks Daniel…Thanks Ben…info helpful as usually…