How to Create Dotted or Dashed Lines in After Effects (2026)
Motion Graphics Tutorial · After Effects · 2026

How to Create Dotted or Dashed Lines
in After Effects

Three complete methods — Shape Layer Dashes, Round Cap dots, and animated Trim Paths — with every setting explained so you know exactly what to adjust and why.

Skill level: Beginner to Intermediate Time: 5–15 minutes AE version: CC 2022 and later Read time: 9 min
Dashed
Dotted (Round Cap)
Mixed Dash-Dot
Curved Path

A dashed or dotted line sounds like a small detail — but in motion graphics it shows up everywhere. Animated travel routes on a map. Dotted outlines drawing on around a product in an ad. Rhythm lines pulsing through a music visualizer. Infographic connectors that draw themselves between data points. All of them come down to the same three controls hidden inside After Effects' Shape Layer stroke settings: Dash, Gap, and Line Cap.

After Effects does not advertise this feature particularly well — there is no "Dashed Line" button in the toolbar. You have to know where to look. This guide shows you exactly where, walks through every setting that matters, and covers how to animate the result with Trim Paths so the line draws itself on screen.

Prerequisites

What You'll Need

This tutorial works in After Effects CC 2022 and all later versions, including the current 2026 release. The Shape Layer dash controls have been available since CS6, though the interface was improved in later CC releases.

📋 Requirements

After Effects CC 2022 or later · A new or existing composition · No third-party plugins required — everything covered here uses only built-in After Effects tools.

After Effects composition workspace — dashed lines are built entirely from Shape Layer stroke settings with no plugins required.

Method 1 of 3

Create a Dashed Line via Shape Layer Stroke

This is the foundational method. Everything else in this tutorial builds on these steps. The key insight: dashes are a property of a Shape Layer's Stroke, not a separate layer or effect. Once you know where to find the Dashes panel, the rest takes less than two minutes.

1
Create a New Composition

Go to Composition → New Composition. Set your resolution (1920×1080 is standard), frame rate (24fps or 30fps), and duration. Click OK.

2
Select the Pen Tool and draw a path

Press G to activate the Pen Tool. Make sure no layer is selected in the timeline — if a layer is selected, the pen tool will draw a mask instead of a shape. Click to set a start point, then click again to set the end point. After Effects creates a new Shape Layer automatically.

3
Remove the fill (keep only the stroke)

In the timeline, expand the Shape Layer: Contents → Shape 1 → Fill 1. Set Opacity to 0%. This makes the fill invisible, leaving only the stroke visible. You can also double-click the Fill color swatch in the toolbar and set it to None.

4
Open Stroke settings and set color + width

Navigate to Contents → Shape 1 → Stroke 1. Click the color swatch to set your line color. Adjust Stroke Width to control the thickness — 4–8px works well for most compositions.

5
Click the + icon next to Dashes

Inside Stroke 1, scroll down to find the Dashes section with a + and button. Click + once. This adds a Dash property — After Effects defaults to a dash of 10px with a 10px gap.

6
Add a Gap and adjust Dash + Gap values

Click + a second time to add an explicit Gap value. Now adjust both: Dash controls the length of each dash. Gap controls the space between them. Try Dash: 20, Gap: 12 as a starting point — then tweak to taste. You can keep clicking + to add alternating dash and gap values for complex patterns.

7
Use Offset to shift the pattern along the path

The Offset value shifts the entire dash pattern along the stroke. Animating Offset over time creates a marching ants / moving dashes effect — useful for conveying motion along a path without using Trim Paths.

💡 Pro Tip — Line Cap matters

The Line Cap option inside Stroke 1 controls how dash ends are rendered. Butt Cap gives you sharp rectangular dashes. Round Cap rounds the ends and is used to make true dotted circles (covered in Method 2). Projecting Cap extends the dash length slightly beyond each end — useful for stylised hand-drawn looks.

Method 2 of 3

Create a Dotted Line with Round Cap

A true dotted line — with perfect circles rather than rectangles — requires one additional change from the dashed line setup: set Dash to 0 and Line Cap to Round Cap. When the dash length is 0 and the cap is round, After Effects renders each dash as a perfect circle with a diameter equal to the Stroke Width.

1
Follow Steps 1–5 from Method 1

Set up your Shape Layer, remove the fill, open Stroke 1, and click + to add the first Dash property as described above.

2
Set Dash value to exactly 0

This is the key difference. In the Dashes section, set Dash = 0. With a zero-length dash, After Effects collapses each dash into a point — which, when combined with Round Cap, becomes a perfect circle.

3
Set Line Cap to Round Cap

Inside Stroke 1, find Line Cap and change it from Butt Cap to Round Cap. This is what transforms the zero-length dash into a visible circle.

4
Add a Gap and adjust the spacing

Click + to add a Gap value. This controls the distance between dots. Smaller Gap = dots closer together. Increase Stroke Width to make larger dots — the dot diameter always equals the stroke width.

💡 To make dots larger, increase Stroke Width — the dot size is always equal to the stroke width when Dash = 0 and Line Cap = Round Cap.
Watch: Adding dashes and gaps to strokes in After Effects — full workflow walkthrough
Method 3 of 3

Animate Your Line with Trim Paths

A static dashed line is useful. An animated dashed line that draws itself onto the screen — used for map routes, infographic connectors, hand-drawn reveals — is what makes motion graphics genuinely come alive. Trim Paths is the After Effects tool that controls which portion of a path is visible at any moment. Keyframing the End value from 0% to 100% makes the line appear to draw itself from left to right.

1
Complete your dashed or dotted line setup first

Make sure you have a Shape Layer with a Stroke, Fill at 0%, and your Dash/Gap values set from Method 1 or Method 2.

2
Add Trim Paths to the Shape Layer

Select the Shape Layer. In the timeline, expand Contents. Click the Add button (the arrow/plus icon to the right of Contents) and choose Trim Paths from the dropdown.

3
Keyframe the End value

Expand Contents → Trim Paths 1. At frame 0, click the stopwatch next to End and set it to 0%. Move to your end frame (e.g., frame 60) and set End to 100%. The line now draws itself from start to end over that duration.

4
Easy Ease the keyframes for smooth motion

Select both keyframes, right-click, and choose Keyframe Assistant → Easy Ease. This adds acceleration and deceleration, making the animation feel natural rather than robotic. Press F9 as a shortcut.

5
Adjust timing in the Graph Editor (optional)

Press Shift + F3 to open the Graph Editor. Pull the handles for a custom easing curve — a slow start followed by a faster reveal often looks best for map route animations.

✅ Start vs End Keyframes — the difference

End keyframe (0→100%): The line draws itself on — the front of the line moves forward. Start keyframe (0→100%): The back of the line catches up to the front — the line disappears. Combining both: Keyframe Start to lag behind End by 20–30 frames to create a snake-like animated line that draws on and simultaneously erases its tail.

Watch: Trim Paths deep dive — animating line reveals in After Effects
Bonus Method

Dashed Lines on a Curved Path

Everything above applies equally to curved paths — the Pen Tool can draw Bezier curves as well as straight lines, and After Effects' dashes follow the path geometry automatically. Here's how to extend the technique to curves:

Using the Pen Tool for Bezier Curves

Instead of clicking to set a point, click and drag with the Pen Tool. Dragging pulls out control handles that define the curve direction and intensity. Set your first curve point, then click-drag to set a second — After Effects draws a smooth Bezier between them. All the same Stroke Dashes settings apply: the dashes conform to the curve automatically.

Using a Shape (Rectangle or Ellipse) as the Path

Draw a rectangle or ellipse using the Shape Tools while no layer is selected. Then go to Contents → Rectangle 1 (or Ellipse 1) → Stroke 1 → Dashes and click + to add dashes. This is perfect for animated dotted borders around elements — combine with Offset animation for a marching-ants selection effect.

🎯 Map Route Animation Tip

For animated map routes, draw your path with the Pen Tool, add dashes, then use Trim Paths to animate the line drawing from city A to city B. Use Alpha Matte technique for the disappearing tail: duplicate the path layer, remove dashes from the duplicate, and set the dashed layer's Track Matte to Alpha. The undashed layer becomes the matte, revealing the dashed line cleanly as it animates off. This prevents the whole stroke from sliding off which is the most common map-route animation problem.

Animated dashed map routes are one of the most common use cases — the technique combines curved paths, stroke dashes, and Trim Paths into a single Shape Layer setup.

Quick Reference

Which Method Should You Use?

All three methods share the same underlying setup — the choice comes down to what visual result you're going for and whether you need animation.

Comparison of three methods for creating dotted and dashed lines in After Effects
Goal Method Key settings Best for
Rectangular dashes Method 1 Dash > 0, Gap > 0, Butt Cap Motion paths, infographic connectors, borders
Perfect circle dots Method 2 Dash = 0, Gap > 0, Round Cap Stylised map routes, decorative dots, timelines
Animated draw-on Method 3 + Trim Paths, keyframe End 0→100% Reveals, map routes, animated arrows, connectors
Marching ants / moving dashes Offset anim. Keyframe Offset over time Selection indicators, energy/power effects
Dashed ellipse border Shape Tool Draw ellipse, add Dashes to Stroke Animated borders, highlight rings, call-outs
Common Issues

Troubleshooting
Common Problems

?

I clicked + but no dashes appear

Check that Fill Opacity is 0%. If the fill is covering the stroke, dashes may appear present in the properties but invisible because the filled shape is on top. Also check that Stroke Width is set to a visible value (at least 1–2px).

If you drew your line with a layer already selected, you may have created a mask instead of a Shape Layer. Check the timeline — a mask will show under the layer's Masks section, not Contents. Delete it and redraw with no layer selected.

?

Trim Paths animates the line drawing on but it slides off strangely

This is a well-known After Effects behaviour. When you animate both Start and End to remove the line from screen, the entire stroke moves off as a unit rather than disappearing from the tail. The fix is the Alpha Matte technique: duplicate the dashed path layer, remove all dashes from the duplicate, animate Trim Paths on the duplicate (not the dashed layer), and set the dashed layer's Track Matte to Alpha Matte from the duplicate. The undashed layer acts as the reveal matte, keeping the dashes stationary while the matte controls what's visible.

?

My dotted line looks blurry or jagged on export

Usually caused by one of two issues: (1) Composition resolution is too low — render at 1920×1080 minimum for clean strokes. (2) The shape layer has been scaled up from a smaller original — never scale a shape layer with dashes; instead, redraw at the size you need. Also enable Continuously Rasterize (the star icon on vector shape layers) to ensure crisp rendering at any scale.

?

I want dashes but I'm working with a mask path, not a shape layer

Mask paths do not support stroke dashes directly. You need to convert the mask to a Shape Layer path first. Select the layer with the mask, then go to Layer → Create Shapes from Vector Layer (if it's a vector layer) or copy the mask path and paste it into a Shape Layer's Path property. Once on a Shape Layer, all the Stroke Dash controls become available.

⚡ Quick Keyboard Shortcuts Recap

G — Pen Tool  ·  V — Selection Tool  ·  U — Reveal keyframed properties  ·  F9 — Easy Ease selected keyframes  ·  Shift + F3 — Open Graph Editor  ·  Spacebar — Preview playback

"A dashed or dotted line is one of the simplest things in After Effects once you find the + button next to Dashes. Most animators never knew it was there — it's just not where you'd expect it."

Summary

Shape Layer Dashes — Strengths & Limitations

What Works Well

  • No plugins required — fully native to After Effects
  • Dashes follow any path shape automatically — straight, curved, or complex
  • Fully animatable — every Dash, Gap, Offset value can be keyframed
  • Round Cap gives perfect circles with Dash = 0
  • Works with Trim Paths for clean draw-on animations
  • Offset animation creates marching-ants effect with zero extra effort
  • Can be combined with Layer Styles for glow, neon, and shadow effects

Limitations to Know

  • Mask paths cannot use Stroke Dashes — must convert to Shape Layer
  • Trim Paths animate-off requires Alpha Matte workaround to look right
  • Complex dash patterns (dash-dot-dash) require multiple + clicks to set up
  • No live preview in the Dashes panel — must watch comp to see changes
  • Scaling shape layers can cause rendering artefacts — redraw at target size instead

Tutorial based on Adobe After Effects CC 2022 through the current 2026 release. Keyboard shortcuts and menu paths are consistent across these versions. Always check your version if a menu item appears missing.