The solution for a value-based trigger usually has to be tailored to your specific situation, but here are a couple of generic solutions that assume "a" is a slider control on a layer name "Control". The first version is for the situation where you only want the animation to trigger the first time the threshold is crossed. Both examples assume that the animated property being driven is time remapping, but if it's a different property (like scale, rotation, etc.) you would just wrap the final line inside valueAtTime()--like: valueAtTime(Math.max(time - t,0))
a = thisComp.layer("Controls").effect("Slider Control")("Slider");
threshold = 50;
t = inPoint;
while (t <= time){
if (a.valueAtTime(t) >= threshold) break;
t += thisComp.frameDuration;
}
Math.max(time - t,0)
This (more complex) version is for when you want the animation to trigger every time the value crosses the threshold:
a = thisComp.layer("Controls").effect("Slider Control")("Slider");
threshold = 50;
triggered = a >= threshold;
t = time - thisComp.frameDuration;
if (! triggered){
while (t >= inPoint){
if (a.valueAtTime(t) >= threshold){
triggered = true;
break;
}
t -= thisComp.frameDuration;
}
}
if (triggered){
while (t >= inPoint){
if (a.valueAtTime(t) < threshold){
triggered = true;
break;
}
t -= thisComp.frameDuration;
}
}
triggered ? Math.max(time - t,0) : 0;
Note that this type of brute-force solution requires more an more processing for each frame, so if your comp is long, things can grind to a halt.