Layer 1 has several markers labeled "hit" as the marker comment. The name is important because I might add more markers to do other stuff.
Layer 2 is at 0% opacity by default.
Whenever the time indicator hits a "hit" marker on Layer 1, I want Layer 2 to go instantly to 100% (no fade-in) and fade back out to 0% over 2 seconds.
Does anyone have any idea how I would go about doing something like this?
So far I have something like this, but it only triggers on the first "hit" marker and ignores the rest:
if (thisComp.layer(1).marker.numKeys > 0 && time > thisComp.layer(1).marker.key("hit").time){
linear(time,0,2,100,0);
}else{
value
}