Elastic Snap Expression for After Effects

Here is a keyframe-less X position animation, using an elastic snap style movement.

The timing is easily defined by placing a marker on your layer (asterisk key).

I’ve made several crude inclusions for varying wobble amounts based on distance traversed and transition time. I’m no coder or mathematician, so suggestions are always welcome! And don’t forget the marker!

Also, I must credit much of the Trigonometry to Dan Ebberts Physical Simulations section of motionscript.com. THE BEST expressions reference anywhere, and he’s a really nice guy.

The Expression

displace = 600 ; //user enters # of pixels to move

startBounce = marker.key(1).time;
speedFactor = 1 + (startBounce – inPoint) ;
veloc = (displace / 50) / speedFactor ;
amplitude = ( displace / 3) / speedFactor;
decay = 3;

t = time – startBounce;

if (t
}else{

x = amplitude*Math.cos(veloc*t)/Math.exp(decay*t)-amplitude;

value + linear(time , 0, startBounce, 0, displace) + [ x , 0 ];

}