0
votes

As the slider number increases I want the layers visible in my comp to increase and visa-versa.

Expression I am using:

t = thisComp.layer("Control").effect("Slider Control")("Slider");
r = thisComp.layer("Control");
if (index - r.index == t) {100} else {0};

Project screenshot

At the moment as you increase the Slider it reveals one layer at at time but I want all layers below the selected index number to stay visible until I lower the Slider amount.

Any help would be appreciated.

1

1 Answers

0
votes

Well, I feel silly. All I needed was to change equal to operator == to less than, or equal to <=.

t = thisComp.layer("Control").effect("Slider Control")("Slider");
r = thisComp.layer("Control");
if (index - r.index <= t) {100} else {0};

Now it works perfectly.