Code: Select all
//scale from null position
L = thisComp.layer("PlayerPos");
pct = 1;
r = 400;
p1 = toComp(anchorPoint);
p2 = L.toComp(L.anchorPoint);
d = length(p1,p2);
mult = ease(d,0,r,pct,0);
scaleAmt = value*(1+mult);
//intertial Bounce
rate = 500;
rampDur = scaleAmt/rate;
freq = 3;
decay = 5;
w = freq*Math.PI*2;
if (time < (inPoint+outPoint)/2){
if (time < (inPoint + rampDur)){
s = linear(time,inPoint,inPoint+rampDur,0, scaleAmt);
}else{
t = time - (inPoint+rampDur);
s = scaleAmt + rate*Math.sin(t*w)/Math.exp(t*decay)/w;
}
}else{
if (time > (outPoint - rampDur)){
s = linear(time,outPoint-rampDur,outPoint, scaleAmt,0);
}else{
t = (outPoint - rampDur) - time;
s = scaleAmt + rate*Math.sin(t*w)/Math.exp(t*decay)/w;
}
}
[s,s]