-
Rotation with Opacity
Good morning,
I want to make a layer have opacity 0 or 100 depending on the rotation of another layer. It is like a cover that is behind a spinning object.
I have solved it like this:
var rotationAvatar = thisComp.layer(“Control General Avatar”).transform.yRotation;
if (rotationAvatar > 52 && rotationAvatar < 310) {
100;
} else if (rotationAvatar > 52 + 360 && rotationAvatar < 310 + 360){
100;
} else if (rotationAvatar > 52 + 720 && rotationAvatar < 310 + 720){
100;
} else if (rotationAvatar > 52 + 1080 && rotationAvatar < 310 + 1080){
100;
} else {
0;
}
But this way I only have 3 laps solved.
I think I would have to do a for, but I am not able to solve it.
I would also like to have the possibility that the opacity does not jump from 0 to 100 at once but does a little interpolation.
Any ideas?