# What are the methods avaiable to draw lines in unreal engine?

**URL:** <https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [September 22, 2022, 10:57am UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052 "2022-09-22T10:57:20Z")\
**Posts on this page:** 17\
**Page:** 5

<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:** [September 28, 2022, 1:49pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/81 "2022-09-28T13:49:16Z")

</div>

See if this can push you in the right direction:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/9/d/69d3b5a496420c78bb523b6459c5c88fe0d90d08.png)

The first point is drawn where the camera is, the second is drawn 200 uus in front of the camera and converted back to 2d - a small pure function so we do not need to spam the same nodes all over again.

From a side, it would look like this:

Are we even still going the right direction?

* * *

Btw, when I tried to do it with a component, it was all over the place and I have little mental stamina left to wrangle its transforms.

---

<div class="post-metadata">

**Author:** ![ronyshaji1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronyshaji1](https://forums.unrealengine.com/u/ronyshaji1)\
**Post date:** [September 28, 2022, 2:02pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/82 "2022-09-28T14:02:40Z")

</div>

Yes this is what i needed and trying to accomplish…since i am using widget component i was trying to find a way to find a widget itself. (here it is Line\_widget). As using widget as component have problem, i am now trying to access the widget into the blueprint. So in the below image as far as I understood, the red marking is widget component and the green box is using the widget itself, right ?

if this is clear then I can implement what you said above as a function and project the line.

 ![IM6](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/c/8/fc8b709868cc8fb7a164447150d5add29921788a.png)

---

<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:** [September 28, 2022, 2:04pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/83 "2022-09-28T14:04:37Z")

</div>

If you got rid of the component (remove the component from sedan), you could add a regular widget like so:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/c/e/bce68b3bd813c37b426bc1a08e767e82e92341f2.png)

You can even use the same variable as before.

---

<div class="post-metadata">

**Author:** ![ronyshaji1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronyshaji1](https://forums.unrealengine.com/u/ronyshaji1)\
**Post date:** [September 28, 2022, 2:09pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/84 "2022-09-28T14:09:34Z")

</div>

Yes i got it now…I removed the widget component from the sedan blueprint and added the widget directly so now i get the line from the camera\_front location. Now need to adjust the other points to get a line…i guess now it is ok

 ![IM7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/c/3/ac37012192e6b9bfd96498602a773e268ea30d6b.png)

---

<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:** [September 28, 2022, 2:21pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/85 "2022-09-28T14:21:12Z")

</div>

> [@ronyshaji1](#):
>
> Now need to adjust the other points to get a line…

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/a/5/6/a5662d54cc69603625907de41c837312de638fea.png)

The above hard coded values will not work, it’s time to:

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/2/7/1270d6b44699291e69bfc5edee11bcfd185127a8.jpeg)

… or you can cheat …

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/b/4/cb4b33351a9d1924fee44adc700c4ce4bd68fa5c.jpeg)

Add some dummies. Draw lines between their world locations. They are attached to the camera and will move with it, but can also move independently.

---

<div class="post-metadata">

**Author:** ![ronyshaji1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronyshaji1](https://forums.unrealengine.com/u/ronyshaji1)\
**Post date:** [September 28, 2022, 2:24pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/86 "2022-09-28T14:24:37Z")

</div>

Thanks for the insight…i will do it and get back here with the feedback…i guess it will work and the default location is relative, right ? Or do i need to change it to world location from the transform tab ?

---

<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:** [September 28, 2022, 2:27pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/87 "2022-09-28T14:27:36Z")

</div>

They should be relative to the camera as default, as they are here. But when you access them you ask for world location, identical to what you already to do with the camera.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/1/9/5/19504538845488a819d7bcdd663813c20597ec30.jpeg)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/0/0/20040df40530275c0932edcb6a7033c32514e440.png)

This should really be done with vector math.

---

<div class="post-metadata">

**Author:** ![ronyshaji1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronyshaji1](https://forums.unrealengine.com/u/ronyshaji1)\
**Post date:** [September 28, 2022, 2:31pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/88 "2022-09-28T14:31:15Z")

</div>

Yes now got it…with the usage of getworldtransform the dummies position changes to world transform. I will try the function you made and see how it goes…Thanks for your time and i guess its around 88 comments in this post… 😀 😀

---

<div class="post-metadata">

**Author:** ![ronyshaji1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ronyshaji1](https://forums.unrealengine.com/u/ronyshaji1)\
**Post date:** [September 29, 2022, 1:28pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/89 "2022-09-29T13:28:03Z")

</div>

Hey, now able to draw line but as you said earlier, basically as it draws on the screen, its thickness changes and also not occluding when the camera goes in far view. Also it takes some time to update the positions when spanning the camera speedily.

So i think i have to look for other methods for my purpose

---

<div class="post-metadata">

**Author:** ![Rama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rama/32/882413_2.png) [@Rama](https://forums.unrealengine.com/u/Rama)\
**Post date:** [August 24, 2023, 8:38pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/90 "2023-08-24T20:38:40Z")

</div>

> [@Everynone](#):
>
> Before you proceed to any of the threads he frequents:
> 
> ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/8/5d8753ca298c0cafd9e6c52b481be2e348f6f14b.png)

I see what you did there @Everynone !

Hee hee!

hee… about 1 year later… hee…

⚡ ❤ ⚡

Rama

---

<div class="post-metadata">

**Author:** ![TheSubZer0](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheSubZer0](https://forums.unrealengine.com/u/TheSubZer0)\
**Post date:** [December 27, 2024, 5:47pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/91 "2024-12-27T17:47:19Z")

</div>

Will It show up in a Scene Capture 2d ?

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 21, 2025, 2:50am UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/92 "2025-02-21T02:50:08Z")

</div>

Can I make curved lines with this method? I need to give a line that represents the trajectory of my planets

---

<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:** [February 21, 2025, 7:54am UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/93 "2025-02-21T07:54:31Z")

</div>

You could use splines or Niagara:

> [@Solar System Simulator/Generator](https://forums.unrealengine.com/t/solar-system-simulator-generator/62571/15):
>
> I lifted what was relevant from an old project (opening 4.17 → 4.27 is no fun at all! wink but still pretty stunned it actually opens & works almost out of the box!): Project link: Here’s what this actor can do: Some basic controls for this are exposed but it needs a ton of features to make it useable / more flexible. I’d start with adding controls for how many SMCs are needed for smaller / larger orbits - currently it’s a fixed number. May be fine depending on what this is going to be u…

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 21, 2025, 4:42pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/94 "2025-02-21T16:42:30Z")

</div>

Thanks for answering me, I used a spline and it was cool, but there’s a problem, it uses mesh to be visible in the game, what I wanted was lines that didn’t change their thickness if you got closer to them, exactly the same as the lines that already have in the unreal editor as is the case with the spline, I thought about using draw lines, but how can I draw ellipses and circles? I know there’s a way to project the world’s coordinates onto the screen, I’ve already managed to do that, but how do I make curved lines with draw lines?

---

<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:** [February 21, 2025, 4:50pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/95 "2025-02-21T16:50:39Z")

</div>

You could try painting them in a widget - splines are supported but there is not much control:

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/e/c/8ec794460e010bd2adaaaf28b5be7bc37bf975ac.png)

You’d run a loop on a data array. Admittedly, BPs are not great at drawing 2D, it’s not user friendly; especially considering how nicely it draws wires in the graphs, right? You’d need to expose the way the editor draws debug lines. Have a look at Rama’s Victory plugin, I believe it includes it.

* * *

On the other hand, there’s a slew of improvements coming to UMG, scroll down to the UI systems:

[https://portal.productboard.com/epicgames/1-unreal-engine-public-roadmap/tabs/94-forward-looking](https://portal.productboard.com/epicgames/1-unreal-engine-public-roadmap/tabs/94-forward-looking)

Chances are we’ll get a line renderer.

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 21, 2025, 5:39pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/96 "2025-02-21T17:39:44Z")

</div>

Thank you, your answers have helped a lot!

---

<div class="post-metadata">

**Author:** ![Axyzz](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Axyzz](https://forums.unrealengine.com/u/Axyzz)\
**Post date:** [February 21, 2025, 10:37pm UTC](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052/97 "2025-02-21T22:37:04Z")

</div>

Alright, I found a post by @Supremative that explains how to draw a spline at runtime. In the post, he shows how to create a wireframe material to apply to a spline mesh, and after doing that, I was able to achieve the effect I wanted, 2D lines in world space using the spline component.

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/6/5/1/6512e2e18a539e55eb4b7276491cc77a4073bf45.jpeg)

[https://forums.unrealengine.com/t/drawing-spline-runtime/1699426](https://forums.unrealengine.com/t/drawing-spline-runtime/1699426)

[Previous page](https://forums.unrealengine.com/t/what-are-the-methods-avaiable-to-draw-lines-in-unreal-engine/654052.md?page=4)
