Copy link to clipboard
Copied
Hello! Thanks for your time!
So, I'm trying to make a square shape layer scale down to 0 once it passes thru a text, so it doesnt cover the text up.
I've got this expression:
But it only references the text's anchor point, which is in the center. My problem is the square shape layer is multiple (lots of squares going thru) and they will come on a 45 degree angle. So if I adjust the distance from the anchor point which the scaling will begin horizontally, the vertical distance gets too large, and vice versa (except it gets too small for the horizontal once I adjust the distance based on the vertical).
I've figured that if I make 4 layers of the same text, each with an anchor point in the extremities (up, down, right, left) and managed to reference each anchor point to the proximity scaling, it should work the way I wanted, but I dont know how to use 4 values in this expression:
Except the brackets doesnt work. Anyone can give me a light? Maybe there is another way to do it that I`m missing. Sorry for any stupid questions, I`m new to the expressions world...
Copy link to clipboard
Copied
try this
len1 = length(position, thisComp.layer("Text1").position);
len2= length(position, thisComp.layer("Text2").position);
len3 = length(position, thisComp.layer("Text3").position);
len4 = length(position, thisComp.layer("Text4").position);
t = Math.min(len1, len2, len3, len4);
s = ease(t, 200, 0, 0, 100);
[s, s]
Find more inspiration, events, and resources on the new Adobe Community
Explore Now