-
How can you combine an if else expression with a linear expression?
Hi, I am trying to link the opacity of one layer to the rotation of a parent null “MASTER”. I want it to be visible from the front, fade as it turns, and not be visible from behind. So, for instance, the opacity should be 100% when the rotation is between -50 and 50 and fade out when it rotates up to 63 degrees either way, and be 0 if the rotation is more than 63 degrees either way.
Can anybody help? I came up with this but it doesn’t seem to be working:
Thanks!
var yRot = thisComp.layer(“MASTER”).transform.yRotation;
if (yRot<-63||yRot>63)0
if (yRot>=50&&yRot<=63)
linear(yRot,50,63,100,0)
if (yRot<=-50&&yRot>=-63)
linear(yRot,-50,-63,100,0)
else 100