# Draw Lines

**URL:** <https://forums.unrealengine.com/t/draw-lines/422195>\
**Category:** C++\
**Tags:** draw, unreal-engine, UE4, CPP, question\
**Created:** [April 9, 2018, 1:46pm UTC](https://forums.unrealengine.com/t/draw-lines/422195 "2018-04-09T13:46:19Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_5691b19e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5691b19e](https://forums.unrealengine.com/u/anonymous_user_5691b19e)\
**Post date:** [April 9, 2018, 1:46pm UTC](https://forums.unrealengine.com/t/draw-lines/422195/1 "2018-04-09T13:46:19Z")

</div>

i have a procedural mesh with vertexes;  
and i want to create from these vertexes lines in 3d space  
how can i do that? “draw debug line” is only for debug… and only for 2 points (i need draw array of points)

thanks, new for unreal, wait for help

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_5691b19e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_5691b19e](https://forums.unrealengine.com/u/anonymous_user_5691b19e)\
**Post date:** [April 11, 2018, 11:40am UTC](https://forums.unrealengine.com/t/draw-lines/422195/2 "2018-04-11T11:40:45Z")

</div>

this is my solution:

```
LineBatchComponent = CreateDefaultSubobject<ULineBatchComponent>(TEXT("LineBatcher"));
 TArray<FBatchedLine> lines;
		for (auto i = 0; i < mVertexes.size() - 1; i += 2)
		{
			FVector start = FVector(mVertexes[i].x,mVertexes[i].y,mVertexes[i].z);
			FVector end = FVector(mVertexes[i+1].x,mVertexes[i+1].y,mVertexes[i+1].z);

			FBatchedLine line = FBatchedLine(start,
				end,
				FLinearColor(1, 1, 1, 0.5),
				10000, // for long period draw
				0.3,
				4
			);
			lines.Add(line);
		}
	}

	LineBatchComponent->DrawLines(lines);

```

---

<div class="post-metadata">

**Author:** ![charli362](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@charli362](https://forums.unrealengine.com/u/charli362)\
**Post date:** [January 13, 2023, 6:31pm UTC](https://forums.unrealengine.com/t/draw-lines/422195/3 "2023-01-13T18:31:11Z")

</div>

I have used this utility extensively and recommend it for all in world line drawing.

---

<div class="post-metadata">

**Author:** ![Matty.9500](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Matty.9500](https://forums.unrealengine.com/u/Matty.9500)\
**Post date:** [February 14, 2023, 9:38am UTC](https://forums.unrealengine.com/t/draw-lines/422195/4 "2023-02-14T09:38:30Z")

</div>

Hi, i using Unreal Engine 5 and using this component/function i noticed that ALPHA of color not work, do you know how i fix it?
