-
Overshoot position expression with ease in keyframe
Hi everybody
I’m trying to apply the overshoot expression from Ebberts to a position animation, but it seems to work only with linear keyframes. I would like to reduce velocity as we approach the second keyframe, but when I convert it to ease in bezier, the expression doesn’t work anymore. Does anybody know how to combine the overshoot expression with an ease in animation? Thanks a lot!
freq = 3;
decay = 5;n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time) n--;
}
if (n > 0){
t = time - key(n).time;
amp = velocityAtTime(key(n).time - .001);
w = freq*Math.PI*2;
value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w);
}else
value