Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Arslan-TR/e356e374b03e01eb648d19f02056b88d to your computer and use it in GitHub Desktop.
Save Arslan-TR/e356e374b03e01eb648d19f02056b88d to your computer and use it in GitHub Desktop.
// auto animation Wiggle
// u can use for position/scale/rotation;
amp = .99;// genlik/amplitude
freq = 2;// titresim sikligi
decay = 5.5;// gecikme/bitis
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment