That requires a little bit of expression pixie dust. First make sure that your Light Rays layer is a 2D layer. Then if you create a 3D Null you can tie the 2D effect’s Center property to it with an expression like this:
l = thisComp.layer("Null 1");
l.toComp(l.anchorPoint);
The first line creates a variable ‘l’ and assigns it the 3D Null layer object. The second line converts the 3D Null layer’s anchor point into a point in composition space (a 2D screen coordinate).
If the layer you’re applying Light Rays to is not composition sized you can enclose the 2nd line in a fromComp() function call like so:
l = thisComp.layer("Null 1");
fromComp(l.toComp(l.anchorPoint));
Generally I recommend that you use a composition sized layer for such an effect though.
You can alt-click on the property’s stop watch to add an expression or press alt-shift-= with the property selected (alt is the option key on Mac). In this case you’d apply the expression to the ‘Center’ property of CC Light Rays.
Darby Edelen