Hi Adam – well 40 and 75 don’t really relate to each other, that’s the point. I gave an arbitrary example, but I ran into a situation the other day where I was trying to rig up some automated movement so I didn’t have to keep animating something meticulously.
I had the object position keyframed, and was controlling the movement between the keyframes with eg. “valueAtTime(slider)”. I had an animated slider controlling various things, and I wanted an object to move a specific amount when the slider was at 75. Then when the slider animated the rest of the way, the object needed to move the rest of its distance.
Edit: Well, I guess some conditional statements seem to work ok.
s = thisComp.layer("Slider Control").effect("Slider Control")("Slider");
if (s <= 75) {
x = linear(s, 0, 75, 0, 40);
}
else {
x = linear(s, 75, 100, 40, 100);
}
y = value[1];
[x, y]