How to Animate a 2D Flag Waving in Adobe After Effects

After Effects 15/06/2019 2 min read

Okay, so you need an After Effects 2D flag waving! Maybe you need it to highlight a patriotic moment, or to signify the start of a race, whatever the reason, you’ve come to the right place. In this tutorial, you’ll learn how to create a waving flag in After Effects by using a shape layer with merge paths. Let’s get started! 

How to Create a 2D Flag Animation

Step 1: Create a New Composition

First up, set up your composition layers. 

  1. Create a new composition. 
  2. Add two layers. Layer 1 will contain your flag pole, plus background elements. Layer 2 will contain your flag, which must be a Shape Layer.

All the best things have layers. Like cake!

Step 2: Adding a Rectangle

Now, create a rectangle shape within your flag layer and position your rectangle at the start point of your wave in the viewer. 

  1. Select the Flag layer.
  2. Open the Add menu. 
  3. Choose Rectangle.
  4. Twirl open the Rectangle, adjust the size to be ¾ width of the flag, and double the height, position just to the left of the flag.

Let’s get waving!

Step 3: Animating the Wave

Time to create the initial animation for your wave. 

  1. Set a keyframe on frame 0.
  2. Move the playhead to frame 60 in the Timeline.
  3. Position the Rectangle to the right of the flag.
  4. Option + click on the Stopwatch, then click on the menu option Property > LoopOut.

And you’re looping!

Step 4: Merge Paths

Add a merge paths to your flag layer so that the rectangle will subtract the flag from the viewer as it loops. 

  1. With the Flag layer selected.
  2. Click on the Add menu.
  3. Choose Merge Paths.
  4. Twirl open Merge Paths, change the Mode from Add to Subtract.

Now that’s what you call magic!

Step 5: Offsetting the Wave

In this step, you’ll duplicate the flag layer, change the mode so that the flag within the rectangle shows on screen, and bump up the height in the viewer to create an offset. An offset makes that part of the flag appear closer to the viewer, making the 2D flag look three dimensional!

  1. Select the Flag layer. 
  2. Type Command + D to duplicate the layer.
  3. Twirl open the duplicated layer, change the Merge Paths Mode from Subtract to Intersect.
  4. In the viewer, move the position of the Flag up slightly from the original flag to create the offset part of the flag.

All that’s all there is to it! 

You now know how to create a 2D waving flag in After Effects, and it’s as simple as animating rectangle merging paths with your flag layer. Now that you know how to create an animated flag, get ready to incorporate this into your next video! Have fun!

Share this article: