Learn how to animate a line in After Effects. Use these simple tools and techniques to animate shapes, text, and more.

An animated line commands the viewer’s attention. As it weaves across the screen, the viewer can’t help but follow its path. It gives the animator the power to direct the viewer’s gaze, drawing attention to critical images or messages.
More importantly, animated lines look really impressive. While an animated line animation might seem complex, it’s surprisingly easy to create once you’ve learned the basics. Read on to learn how to animate a line in After Effects.
Why Use After Effects for Animation?
After Effects gives you the tools to create almost any animation you can imagine. It’s a powerful piece of software with a vast array of features. Plus, it’s an industry-standard software widely used in film, television, and advertising.
After Effects line animation is a skill set every animator should have in their toolkit. There is a wide range of fun and dynamic ways to add movement to a line, whether tracing cursive lettering, drawing the outline of a logo, or creating playful motion graphics.
This tutorial will introduce you to some popular ways to animate lines in After Effects.
A Quick Introduction to Shapes and Masks
Before we dive into animating lines, read on for a quick crash course on Shapes and Masks. These tools are an integral part of creating After Effects line animations.
The Shape Tool
The Shape Tool will allow you to create one of five shapes: Rectangle, Rounded Rectangle, Ellipse, Polygon, or Star.
You can find it in the Tools panel at the top of your screen; just look for the rectangle icon. Click and hold the Shape Tool to choose from five shape options. Alternatively, press Q on your keyboard to toggle through the shape options.
The Pen Tool
The Pen Tool will allow you to draw a line in After Effects. You can create any line drawing your heart desires, whether a wavy line or a jagged abstract shape.
You can also find it in the Tools panel—just look for the fountain pen icon. Click on the Pen Tool or press G on your keyboard.
Shape Layers
Choose the Shape or Pen Tool, then draw your shape in the composition window.
A new Shape Layer will appear in your Timeline when you’ve drawn your shape. You can customize the appearance of your shape via this layer. Just expand the menu using the drop-down arrows (as shown in the above image).
Here, you’ll be able to edit the following menus:
- Path: Edit the dimensions and attributes of your shape.
- Stroke: This is where you’ll customize your line. The stroke menu gives you a lot of control over the appearance of your line. You can edit the width, choose whether the ends of your line are square or rounded, create dotted lines, taper the width of the line, or create wavy lines.
- Fill: Edit the fill color of your shape (or you can delete this property if you want your shape to be an empty outline).
- Transform: Edit simple attributes like position and scale.
Any lines in a shape layer can be animated using the ‘Trim Paths’ tool. Read on to learn how!
Masks
The shape tools can also create Masks for other layers on your Timeline.
To create a mask, select a layer on your Timeline to create a mask, then draw a shape over that layer in the Composition window. Rather than create a new layer, After Effects will add a Mask over the selected layer.
A mask can then be used as a path for a line animation via the ‘Stroke’ effect. You’ll learn how to do this a little later in the tutorial.
Now you’re ready to learn to draw a line in After Effects!
How to Animate a Line in After Effects
There are multiple ways to animate a line in After Effects. Each method has unique advantages; it just depends on what you’re trying to do.
Using ‘Trim Paths’ to Draw Shapes
If you’re creating a new shape or line drawing within After Effects, then Trim Paths is your best option to animate your lines.
Start by drawing your shape, then customize the line to your liking using the method outlined earlier.
Now look for the Add button within your shape layer. Click the button, then select Trim Paths (as shown in the below image).
A new Trim Paths menu will appear in your layer with the following properties:
- Start: Set the start point of your line along the shape path (e.g. 0% means your line will start at the very beginning, 50% means it will begin halfway along the path, etc.)
- End: Set the end point of your line along the shape path (e.g. 100% means your line will finish at the very end, 50% means it will finish at the halfway point, etc.)
- Offset: Adjust the location of the Start/End point along your shape path.
Now it’s simply a matter of using keyframes to animate the line.
Want to start with a blank screen, then have your shape trace on? Keyframe the End property from 0% to 100%.
Now do you need that same shape to trace away? Keyframe the Start property from 0% to 100%.
What if you want a line that constantly snakes along the shape path? Adjust the Start and End properties to get the line to your desired length, then keyframe the Offset property.
Play around with all three Trim Paths properties, and you’ll quickly learn how to tweak them to suit your needs.
Using ‘Stroke’ to Trace Masks and Reveal Images
The Stroke effect can do the same thing as Trim Paths, but it works completely differently.
Rather than tracing a Shape path, Stroke will trace a Mask path.
The beauty of this is that it allows you to animate lines on top of an image or video layer. You can either draw a line over an existing image or use that line like a mask to reveal the image underneath. Start by creating a mask using the steps we learned earlier.
In the above example, the aim is to get the Stroke effect to trace the letters of the “hello” graphic, so you’ll start by drawing a mask that follows the path of the letters.
Then go to your Effects panel and search for ‘Stroke.’ Drag the Stroke effect onto your layer.
Now go to the Effect Controls panel to edit the following properties:
- Path: Choose which Mask you’d like to trace.
- All Masks: Tick this checkbox if you’d like to trace all masks.
- Stroke Sequentially: Tick this checkbox if you’d like the effect to trace one mask at a time. Otherwise, it will trace all masks simultaneously.
- Brush Size, Brush Hardness, and Opacity: Adjust the appearance of the line.
- Start and End: These properties work the same as in Trim Paths.
- Spacing: Adjust this property to create a dotted line.
- Paint Style: This is an important one. Choose from the drop-down box to allow the line to draw over the top of your image, draw onto a transparent background, or reveal the original image.
In the below example, ensure your line is thick enough to cover the entire image. Then change the Paint Style to Reveal Original Image.
Now it’s simply a matter of keyframing the Start and End properties, using the same techniques used for Trim Paths earlier.
When you set the End property to 0, your image will disappear. Then keyframe to 100 to reveal your image.
Use Auto Trace to Create Quick and Easy Line Animations
Another great advantage of the Stroke effect is that you can pair it with the Auto Trace feature for a quick and easy way to animate lines in After Effects.
Auto Trace will take an existing image (say, a PNG image of a logo) and will create a mask around the outside edge of the image. Applying the Stroke effect to this mask gives you a quick and easy way to trace your image with an animated line.
Start by importing your image file. Ensure you’ve chosen a high-res image with a transparent background. Add the image to your composition.
Next, with the image layer selected in your composition timeline, click Layer > Auto Trace…
Leave the settings as they are (the default settings should be fine if you’re using a large, clean image on a transparent background), ensure you’ve unchecked the Apply to a new layer box, and then click OK.
A mask path will appear around the outer edge of your image.
Now, apply the Stroke effect, and follow the method you learned earlier.
It’s as simple as that! You’ve created an intricate line animation in a matter of minutes.
To Wrap Up
Learning how to animate in After Effects may seem overwhelming initially—after all, After Effects is a versatile program with a massive catalog of features.
But by slowly adding skills to your toolkit, you’ll build your capability piece by piece, becoming faster and more confident as you go.
Learning how to animate lines in After Effects is a huge step forward and an essential skill for any animator—it looks great and is a surefire way to impress clients on your next project. Keep practicing and experimenting with animated lines using the techniques you learned today.
Want to learn more about After Effects animation? Check out the Top 10 After Effects Tutorials for Beginners and see which of the Top 10 After Effects Templates you prefer. Or find your own After Effects templates at Envato Elements and see what you can create with them. Happy animating!



