

Here's fun a variation that you can use on a text layer to get the text characters to randomly scale up from zero to 100 percent, with overshoot.

This is an extremely useful and versatile expression. It's worthwhile playing around with the expression to see the interaction between frequency, incoming velocity, and resulting overshoot amplitude. If you want a larger overshoot, you need to either increase the incoming velocity, or reduce the oscillation frequency. One important thing to remember with overshoot is that you don't have direct control over the overshoot amplitude (the amp variable is calculated by the expression). In practical terms this means that the higher the frequency of oscillation, the lower the resulting amplitude of the overshoot. Without getting into a lot of detail, it turns out that dividing the incoming velocity by the angular velocity of the oscillation gives an overshoot that matches perfectly. Here, w represents the angular velocity of the oscillation. The trick to making the velocities of the two animations match is the mysterious variable w. Notice that the transition from the linear() ramp to the overshoot oscillation (which happens at frame 5) matches perfectly. Here's a basic expression that will scale the layer from zero to 100 percent over one tenth of a second, starting at the layer's In Point: We'll set it up so the animation triggers at the layer's In Point. For example, let's say you want a layer to scale up from zero to 200 percent over a short period of time and then overshoot a little and settle in at 200 percent. In some cases, you may have an animation where the incoming velocity is determined by the expression itself. The way that you accomplish this depends on the nature of your animation. The trick is to get the amplitude of the overshoot oscillation to match the incoming velocity. More often though, you'll want to use the exponentially decaying sine wave to provide some oscillating overshoot at the end of another motion. That's a handy expression, and sometimes it's all you need. The sine wave gets multiplied by the amplitude variable ( amp) and that result gets divided by the value of the exponential curve, resulting in the desired exponentially decaying sine wave. The Math.exp() piece generates a curve that increases exponentially at a rate determined by variable decay.
After effects text animation bounce plus#
The Math.sin() piece generates a sine wave of frequency freq that varies in amplitude between plus and minus one. There are three things going on in the last line.

All the real math happens in the last line. Variable t is used to calculate the time since the layer's In Point. The first three lines just set the parameters for the waveform: maximum amplitude of 80, frequency of one oscillation per second, and a decay (how fast the amplitude diminishes) value of one. Take a look at the basic expression for an exponentially decaying sine wave:Īmp*Math.sin(t*freq*Math.PI*2)/Math.exp(t*decay) Īs it sits, this expression will trigger a decaying sine wave oscillation at the layer's In Point. If you're tempted, please refer to my Expression Speed and Frequency Control article to see what's involved in doing it correctly. You might be tempted to simulate this bounce behavior by taking the absolute value of the oscillating sine wave (using the JavaScript Math.abs() function) and linking the frequency variable to a slider which you would keyframe to speed up. Notice that the bounces occur more frequently as the object loses energy. This waveform is generated by a bounce simulation expression. The object stops at the top of the bounce and then accelerates (due to the force of some gravity-like phenomenon), so the math involved is completely different.
After effects text animation bounce series#
In fact, the bounce waveform is actually a series of parabolas of decreasing amplitude. That means a sine wave simulation is not adequate for a bounce. As the amplitude of the bounces decrease, they happen more often. When an object bounces, it loses energy on each bounce, which affects both the amplitude and the frequency.
