Hey Dan, very very old thread but thanks for it!
The first expression works for me like a charm but when I reach the last keyframe it’s set to default. If I duplicate the last keyframe I can avoid it but it would be more elegant when I reach the last keyframe and I leave it in the timeline the value is still the last keyframe’s value. Could you help how can I achieve this? Thanks!
p = transform.position; // property you want to monitor
v = value;
if (p.numKeys > 0){
n = p.nearestKey(time).index;
if (p.key(n).time > time) n--;
if (n > 0 && n < p.numKeys)
v = linear(time,p.key(n).time,p.key(n+1).time,0,100);
}
v