I dont see how you can get 1% opacity since your expression can only return 0 or 100.
Two things that might happen:
– the alpha at your beam endpoint is never exactly 1, hence your expression always returns 0;
– you are sampling the wrong point (this could come from the point control attached to the null).
I tried this expression on a fake project and it did what it is supposed to do:
target = thisComp.layer(“beam”);
P = thisComp.layer(“beam”).effect(“Beam”)(“Ending Point”);
target.sampleImage(P,[.5,.5],true)[3] * 100;
If it works for you too then you can replace the last line with:
alpha = target.sampleImage(P,[.5,.5],true)[3];
(alpha==1) ? 100 : 0;
Xavier