-
Change value when position reaches certain value
Hello,
I want Opacity to change the value from 100 to 50 when the Shape Layer position is around [90, 90] and [110, 110]. I wrote this expression on opacity
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 changing exactly at the value [100, 100] but I wanted to change it when a and b value is within 90 to 110