Skip to main content
Participant
January 9, 2024
Question

How to animate a line that erases itself?

  • January 9, 2024
  • 1 reply
  • 437 views

Hello guys. I'm trying to animate a line that "erases" itself once the shape is fully shown. Once I do it, I want to loop that effect. Like this:

and then come back to erase the line again, as in frame 1


The first keyframes at the Trim Path bar are set to 0 at the beggining, then the second keyframe at 100. I tried to low the third keyframe to 0 again, but it caused a totally unwanted effect, as shown below

 

What should I do to achieve the effect I want?

This topic has been closed for replies.

1 reply

Community Expert
January 9, 2024

Use a shape layer with a stroke. Add Trim Paths, then animate start and end values to create the draw on, then erase behavior. Both the Start and End must have keyframes on the first frame of the animation. When you have animated the path so it draws on and then draws off, make sure both keyframes have a keyframe at the end of the animation. Then, move one more frame down the timeline and copy and paste the first keyframes again. Then just add a loopOut expression, and the line will draw on and off as long as the layer lasts.