Tips & Tricks

How to Animate With a Wiggle Expression in After Effects

How to Animate With a Wiggle Expression in After Effects

Tuts+Photography
Final product imageFinal product imageFinal product image
What You'll Be Creating

In this tutorial, we will learn about a really useful expression called wiggle in Adobe After Effects by using an example project.

example projectexample projectexample project

In the example project, we have a bunch of separate leaves layers in the corner. And we already have some basic scale animations applied to each of them that are controlled using the adjustment layer at the top (called Leaf_Cont_01).

scale animationscale animationscale animation

The final thing that I want to do with these leaves is give them some wiggle in the rotation property to add more life to the graphics. So rather than keyframe the animation, which would be very tedious, the wiggle expression will do that all for us and requires no keyframes.

How to Add a Wiggle Expression

To add a wiggle expression, Alt-Click on the rotation stopwatch to start. Then type in wiggle into the expression console. 

After Effects will then prompt you to type in a value inside the parentheses. So we need the word wiggle and then a couple of values inside the parentheses for this expression to work. We need a frequency value and an amplitude value, and these two properties will be separated by a comma.

type wiggletype wiggletype wiggle

So let's add a frequency of 10 which is the first number, and this is going to be the amount that the rotation is going to move. So this means ten times a second.

And then we need a second number which will be the amount. For this example, we'll use 30 for now. And then let's press Enter on the numeric keyboard.

add numbersadd numbersadd numbers

Press the play preview button to see what the animation looks like. And in this example it should look as if the leaves are blowing violently in the wind. So we might want to slow it down.

too fasttoo fasttoo fast

You can also go into the post expression graph and look at how the animation works. So over time, without doing any keyframes, this property is basically animating itself. And this is what wiggle does, and it does a great job of it.

post expressionpost expressionpost expression

But for this project we want something a little subtler: maybe something like 0.5, and then maybe 5 degrees of wiggle. And if you play preview it again, you should notice that the animation is much calmer.

calmer animationcalmer animationcalmer animation

How to Add a Wiggle Expression to a Controller

To make it easier to adjust the wiggle expression in the future, or to add the wiggle expression to other layers, we can add these properties to the controller layer located at the top of the layers panel.

This is done by creating a Null layer and adding sliders to it.

create null objectcreate null objectcreate null object

So let's add another slider control to the control layer (Effect > Expression Controls > Slider Control). And name it 'Wiggle Frequency'. 

add another slideradd another slideradd another slider

Duplicate the slider and rename the new slider 'Wiggle Amplitude'.

add wiggle amplitude slideradd wiggle amplitude slideradd wiggle amplitude slider

To apply the expression to the slider, we need to go down to the wiggle expression and select the 0.5 value. And then use the pick whip and click and drag it up to the Wiggle Frequency slider.

pick whip to wiggle freqpick whip to wiggle freqpick whip to wiggle freq

Select the 5 value and use the pick whip to click and drag it up to the Wiggle Amplitude slider.

pick whip to wiggle amppick whip to wiggle amppick whip to wiggle amp

If you get an error, you need to make sure that you close the parentheses at the end. 

errorerrorerror

So once we have that, we're all good to go. Now you can use the sliders to easily adjust the values that you want. Make sure that you add the right values to the sliders in the Leaf_Cont_01 layer and play preview the animation to make sure it all works.

How to Apply a Wiggle Expression to Other Layers

The last thing that we need to do is copy the expression on the rotation. So press Control-C or right-click on the rotation and select Copy Expression Only.

copy the expressioncopy the expressioncopy the expression

Select the other layers you want to apply the expression to and press R on the keyboard to bring up the rotation option.

press r on the keyboardpress r on the keyboardpress r on the keyboard

Select all of them and then paste the expression in (Control-V). And now all the layers have a wiggle expression applied to them, and they can all be controlled using the Leaf_Cont_01 layer.

paste the expressionpaste the expressionpaste the expression

The great thing about the wiggle expression is that it has some quasi-random variation to it. So even if you apply the same frequency and amplitude to different things, they're going to have a different animation because there are some random values happening in the background.

Congratulations

wigglewigglewiggle

Congratulations! And that's how you can add the wiggle expression in Adobe After Effects. Now that you've learned how to use a wiggle expression, check out some of the other tutorials we have on Adobe After Effects below.

I hope you've found this tutorial useful, and I'll see you next time on Envato Tuts+!