How to Rig a Lens Flare in After Effects
Learn how to rig a dynamic lens flare using native plugin's and effects in After Effects. The expressions used in the video can be found below.
Negative X
mlt = 2;
dist = (mlt+1)*(width/2);
FP = thisComp.layer("Flare Position").transform.xPosition*-1;
EQ = (dist+FP)/mlt
Negative Y
mlt = 2;
dist = (mlt+1)*(height/2);
FP = thisComp.layer("Flare Position").transform.yPosition*-1;
EQ = (dist+FP)/mlt
Positive X
mlt = 1.5;
(width/2)+(thisComp.layer("Flare Position").transform.xPosition/mlt)-(width/(mlt*2))
Positive Y
mlt = 1.5;
(height/2)+(thisComp.layer("Flare Position").transform.yPosition/mlt)-(height/(mlt*2))
Also if you would like to download the project file here is a link: