-
Random number held for a specific amount of time
I currently have an expression in place that ties each layer’s opacity in a comp to a slider outside of that comp(if the slider is at value 16 then layer 16 inside that comp is 100% opacity, all other layers are 0%). I would like to add a variability to it, so that the slider could or couldn’t turn on a layer and then I want to hold that outcome for some time. I thought perhaps random could work but I’m unsure how to implement this idea. The current expression is below
C = comp("PARENT COMP");
ctrl = C.layer("CHILD COMP").effect("Slider Control")("Slider");
L = C.layer(thisComp.name);
val = Math.round(ctrl.valueAtTime(time+L.startTime));
if (Math.abs(index - val) <= 0) 100
else 0;