Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity › Forums › Adobe After Effects Expressions › The opacity of a layer trigger by the position of another layer

  • The opacity of a layer trigger by the position of another layer

    Posted by Christophe Zidler on November 21, 2020 at 6:36 pm

    Hi Everybody,

    I’m terrible at expression, and I really need your help.

    I’m looking for an expression that can trigger the opacity of “layer A” based on the position of “layer B”. Basically when B is on top of A he will be at 100% opacity when he will be a bit further opacity will be less. To make kind of a fall of.

    I’m not gonna lie, I know very small of expression, most of the time I’m looking expressions on internet that I copy and adapt. But this time I really can’t find anything about that.

    Thank you for you help.

    Christophe Zidler replied 5 years, 10 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    November 21, 2020 at 10:53 pm

    something like this maybe:

    L = thisComp.layer("target");

    falloff = 200;

    d = length(toComp(anchorPoint),L.toComp(L.anchorPoint));

    linear(d,0,falloff,100,0)

  • Christophe Zidler

    November 22, 2020 at 10:07 am

    Hi Dan !

    Thanks you so much 🙂

    It works perfectly !!

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy