-
Trigger Expression for X value
I looking to fly in an object on it’s x axis and bounce to still when it hits the center mark.. I’ve added a “marker” to trigger the expression. My question is how to modify this expression to trigger the expression again further down in the timeline. It seems like the “bounce” is relative to the beginning of the ‘time’line. Thanks Guys
n = 0;
if (marker.numKeys > 0){
n = marker.nearestKey(time).index;
if (marker.key(n).time > time){
n–;
}
}if (n == 0){
value;
}else{
veloc = 35;
amplitude = 150;
decay = 4;
t = time – marker.key(n).time;
x = amplitude*Math.cos(veloc*time)/Math.exp(decay*time);
value+[x,0];
}