# How to draw animated line between widgets?

**URL:** <https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509>\
**Category:** Blueprint\
**Tags:** unreal-engine, Blueprint, question\
**Created:** [May 15, 2024, 4:48pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509 "2024-05-15T16:48:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AllGamesSuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AllGamesSuck](https://forums.unrealengine.com/u/AllGamesSuck)\
**Post date:** [May 15, 2024, 4:48pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509/1 "2024-05-15T16:48:50Z")

</div>

Hi, is there a way to draw an animated line between 2 widgets, edge to edge, when one of them is hovered?

By animated line, I mean, maybe changing its transparency in a loop, or “growing” the line from one widget to another.

Thanks.

---

<div class="post-metadata">

**Author:** ![Jbl86](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jbl86](https://forums.unrealengine.com/u/Jbl86)\
**Post date:** [May 15, 2024, 5:08pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509/2 "2024-05-15T17:08:52Z")

</div>

I’m not sure I’m super clear on what you are trying to do, is there an example from a game that you’d be able to show?

Changing the transparency in a loop should be fairly easy using the widget animation and adding the line’s color’s alpha as a track. The animation can be set to loop and you can use keyframes to make the value go from 1 to 0 then back to one and that’s the entire animation.

I’m not sure about growing the line (though I’m also not sure what you mean).

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2024, 5:11pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509/3 "2024-05-15T17:11:03Z")

</div>

> [@Draw a Line between two widgets](https://forums.unrealengine.com/t/draw-a-line-between-two-widgets/485568/2):
>
> Ensure the Skill Icons are parented to a Canvas so you can get their positions: The parent widget can draw lines using those coordinates. That’s the gist. The actual implementation would depend on whether this needs to be dynamic. Perhaps you can just draw lines in Gimp / Photoshop / Paint and slap icons on top in the UMG.

Animating is a matter of providing appropriate coords. You know the direction, increase a scalar and you’re good. Opacity can be animated as well.

Widgets can use splines these days, too - considering how the entire visual scripting is a bunch of animated wires… it’s high time they did, right?

* * *

Also:

> **[Niagara UI Renderer](https://www.fab.com/listings/1bd04141-c553-4b63-8ee9-277595475195)**
>
> Video: https://youtu.be/iFa40Sf4QPAThe Niagara UI Renderer Plugin adds a Niagara Particle System Widget that allows you to render Niagara particle systems directly into the UI. The plugin supports sprite and ribbon CPU particles.With this plugin...

---

<div class="post-metadata">

**Author:** ![AllGamesSuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AllGamesSuck](https://forums.unrealengine.com/u/AllGamesSuck)\
**Post date:** [May 15, 2024, 6:54pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509/4 "2024-05-15T18:54:08Z")

</div>

> [@Everynone](#):
>
> Widgets can use splines these days, too

Is there any documentation on that, or do you refer to the UMG splines plugin?

---

<div class="post-metadata">

**Author:** ![AllGamesSuck](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@AllGamesSuck](https://forums.unrealengine.com/u/AllGamesSuck)\
**Post date:** [May 15, 2024, 8:03pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509/5 "2024-05-15T20:03:51Z")

</div>

Also, that post you linked uses onPaint. I was wondering if there’s a way to use “Draw Line” with onHovered, which I need.  
I also thought there is no way to perform any operation on the line drawn by the “Draw Line” node. Can it really be animated?

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [May 15, 2024, 9:20pm UTC](https://forums.unrealengine.com/t/how-to-draw-animated-line-between-widgets/1857509/6 "2024-05-15T21:20:42Z")

</div>

Yes, onPaint fires every frame. OnHovered just needs to supply data. Drawing lines requires context which is not available outside of onPaint. That’s the whole point of its existence, tbh.
