How to use the After Effects Wiggle Expression

CG Director Author Alex Glawion  by Alex Glawion   ⋮   ⋮   10 comments
CGDirector is Reader-supported. When you buy through our links, we may earn an affiliate commission.
How to use the After Effects Wiggle Expression

The Wiggle Expression in After Effects (or ae wiggle for short) is a great way to make objects move randomly, have some sort of idle Movement in character joints, animate a random camera shake, create wobbly text or animate a blinking/flickering light.

Although it is somewhat common knowledge what Wiggle does, I often times find myself sitting in front of my state-of-the-art After Effects Workstation realizing, that I have once again forgotten how the correct wiggle Expression syntax is and what parts of the Wiggle Expression does what.

So here are some basic and advanced wiggle() Expression snippets for you to copy and paste into your After Effects projects and adjust to your liking:

Basic After Effects Wiggle Expression explained

wiggle(freq, amp, octaves=1, amp_mult=.5, t=time) 

//freq being the frequency, so how often per second the value should wiggle //amp being the amplitude, so how far the value should wiggle
//octaves is the number of octaves of noise to add together.
//This value controls how much detail is in the wiggle.
//Make this value higher than the default of 1 to include higher frequencies or lower to include amplitude harmonics in the wiggle.
//amp_mult is the amount that amp is multiplied by for each octave.
//This value controls how fast the harmonics drop off.
//t is the base start time.

 

Wiggle Expression examples

//wiggle far but slowly
wiggle(1.2, 700);

//wiggle a bit faster but not so far
wiggle(3, 20);

//wiggle fast but not far
wiggle(11, 7);

 

Making wiggle start and stop at specific times

//If your wiggle expression should start at 3 seconds
timeToStart = 3; 
if (time > timeToStart){ 
    wiggle(3,25); 
}else{ 
    value; 
}

//If your wiggle expression should stop at 10 seconds
timeToStop = 10; 
if (time > timeToStop){ 
    value; 
}else{ 
    wiggle(3,25); 
}

//If your wiggle expression should start at 5 seconds and stop at 15 seconds
timeToStart = 5; 
timeToStop = 15; 
  
if ((time > timeToStart) && (time < timeToStop)){ 
    wiggle(3,25); 
}else{ 
    value; 
}

 

Tell the wiggle Expression to only wiggle in one direction

//wiggle only in x (horizontal):
org=value;
temp=wiggle (5,50);
[temp[0],org[1]];

//Shorthand:
[wiggle(5,50)[0],position[1]]

//wiggle only in y (vertical):
org=value;
temp=wiggle (5,50);
[org[0],temp[1]];

//Shorthand:
[position[0],wiggle(5,50)[1]]

 

For more organic and natural looking wiggles also try these tips by Tyler on his Motion Array Site. You can also spice things up by adding a random generator to your wiggle. Here is how to.

 

What useful Wiggle Expressions do you know of? Share your knowledge in the Comments.

 

Find a new friend on the CGDirector Forum! Expert Advice & PC-Build Planning with a warm and friendly Community! :)

Alex Glawion - post author

Hi, I’m Alex, a Freelance 3D Generalist, Motion Designer and Compositor.

I’ve built a multitude of Computers, Workstations and Renderfarms and love to optimize them as much as possible.

Feel free to comment and ask for suggestions on your PC-Build or 3D-related Problem, I’ll do my best to help out!

10
Comments
Also check out our Forum for feedback from our Expert Community.

Arseniy

Thanks a lot. Very useful article. Just one more question: How can I make wiggle start intensively with high values and frequencies, but fade with time, so that my objects doesn’t move in the end?

Alex Glawion
Alex GlawionCGDIRECTOR

You’ll need to add in the time component into your wiggle. instead of adding a fixed number to the strength add something like:

(10-time)

That way the strength starts at 10 and then decreases over time.

Cheers
Alex

treakzy_

Hi, i’m an beginner, can somebody please help me with the start and stop at specific times expressions? I tried to copy paste them, but they didn’t work. Everything else works fine 🙂 thanks for the explanation 🙂

Alex Glawion
Alex GlawionCGDIRECTOR

Hey treakzy_,
What exactly doesn’t work? Did you adapt the start and stop times to what you need?

Cheers,
Alex

Slava

Thank’s a lot!

Favour

I can’t find the wiggle effect in effect & present.
I’m using cs6

Alex Glawion
Alex GlawionCGDIRECTOR

Hey Favour,
If you have activated the Expression on your Property such as the Position Property (Menu Animation -> add expression), you should be able to find it under property -> wiggle.

See this image here:

https://www.cgdirector.com/wp-content/uploads/media/2017/03/Screenshot_1-3.png

Hope this helps,
Alex

Ben G

Hi Alex,

Does the wiggle expression work of parameters like “Mask Feather”?

I just finished building a rig and would like your opinion on it.
It’s first priority was gaming during my off hours; Second strong enough for rendering at home if needed/ working on personal projects.

CPU: Ryzen 2700
RAM: Corsair Vengence LED 3000MGHz (2x16GB DDR4 kits)
GPU: Gigabyte Aorus GTX 1080Ti 11GB GDDR5
Boots off SSD
6TB* RAID 5 work drive (*configured size)
1000W Corsair PSU

Thank you for your time.

Alex Glawion
Alex GlawionCGDIRECTOR

Hey Ben,
Sure, Mask Feather can have a wiggle applied to it as well.

Some thoughts on your build. It will definitely work! The 1080Tis are unreasonably expensive nowadays, as the stock is disappearing. So might want to look at a RTX 2070 or some other card from the current generation.

1000W PSU is not really necessary, you could do with a ~550W PSU for those components unles your RAID consists of a lot of drives, but 6TB is not that much.

What are you planning on Rendering in? After Effects?

Cheers,
Alex

Ben G

Alex,
I know the PSU is more than I need but it will allow headroom for overclocking and building a larger RAID when needed.

I managed to get the base components for my PC at $1,500 total, used for 1 month before I bought the PC. I rebuilt it to ensure that everything was done correctly to my satisfaction.

Yes I will be rendering in After Effects .

Newsletter Subscribe CGDirector Logo