Copy link to clipboard
Copied
I've just started looking in adding spring expressions to save time on animation and i've copied a few expressions off website to get a nice bounce an all so far don't want to work. I keep getting an error. See attached. Am i missing something fundamental??
Copy link to clipboard
Copied
We can't know. Show us the full expression code and explain exactly where you are applying it. also, by all means start by renaming your layers and comps suitably. Wrongly handled named references often cause all sorts of issues.
Mylenium
Copy link to clipboard
Copied
Below is the expression i copied from a site and i was just trying to apply it to a scale on some text (For small-to-medium sized enterprises)
n=0;
if(numKeys>0){n=nearestKey(time).index;if(key(n).time>time){n--;}}
n==0?t=0:t=time-key(n).time;
freq=1/duration;
mult = (bounces-Math.floor(t*freq))/bounces;
if (n>0 && mult>0) {
v=velocityAtTime(key(n).time-0.001)*amp; //velocity to use
b=Math.abs(Math.sin(freq*t*Math.PI))*Math.pow(mult,decay); //bounce calculation
value-v*b;
} else {value;}
Copy link to clipboard
Copied
What site was it? I don't think you have the full code copied.