In AE CS6, I get an error message when using this inertial
bounce expression:
amp = .04;
freq = 5;
decay = 5;
n = 0;
if (numKeys > 0){
n = nearestKey(time).index;
if (key(n).time > time){
n--;
}}
if (n == 0){ t = 0;
}else{
t = time - key(n).time;
}
if (n > 0){
v = velocityAtTime(key(n).time - thisComp.frameDuration/10);
value + v*amp*Math.sin(freq*t*2*Math.PI)/Math.exp(decay*t);
}else{value}
I am using this on two position keyframes. The funny thing is that I can
preview/pre render it a few times and it works fine, then the
error message comes up randomly and then the expression is broken. What's also strange is that I am using the same expression on another comp in the same project with not problems. Pulling my hair out!
Any thoughts? Thanks!