How can I add delay to the inertial bounce expression? (HELP!)
- June 28, 2022
- 4 replies
- 1487 views
I'm doing a project where I have 4 shape layers (A, B, C, D) stacked one on top of the other with a NULL layer as a parent. The null layer is animated in the Y-position, but as the null reaches its last point, I want the other layers to have an inertial bounce with delay (delay the bounce).
I tried this expression on layer A, and it works, however when I put it on layers B, C, and D they are all bouncing at the same time.
freq = 1.5; decay = 10; p = parent.transform.yPosition; n = 0; if (p.numKeys > 0){ n = p.nearestKey(time).index; if (p.key(n).time > time) n--; } if (n > 0){ t = time - p.key(n).time; p1 = toWorld(anchorPoint,p.key(n).time); p0 = toWorld(anchorPoint,p.key(n).time - .01); amp = (p1 - p0)/.01; w = freq*Math.PI*2; value + amp*(Math.sin(t*w)/Math.exp(decay*t)/w); }else value
I hope I'm making sense.
I will appreciate any feedback.
Thank you in advance
