-
Change value when position reaches certain value
Hi,
I want Text layer Opacity to change its value from 100 to 50 when the shape layer reaches the position x & y value between 90 and 110.
x = transform.position[0];
y = transform.position[1];
a = thisComp.layer("Shape Layer 1").transform.position[0];
b = thisComp.layer("Shape Layer 1").transform.position[1];
z = x + y;
c = a + b;
if(z == c){
50;
} else {
100;
}
// Comp Size = 200, 200
// x and y value = [100, 100]
// a and b value = [100, 100]in this, the opacity is exactly changing when Shape Layer reaches [100, 100],
but I want opacity to change when the shape layer position value is between [90,90] and [110, 110]And if the Text Layer position is [50, 50] opacity should change from 100 to 50 when the Shape Layer position value reaches + or – 10(between [40, 40] and [60, 60]) to the Text Layer position value.