# Draw debug lines for line tracing

**URL:** <https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [April 11, 2014, 1:07pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307 "2014-04-11T13:07:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lordink](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lordink](https://forums.unrealengine.com/u/Lordink)\
**Post date:** [April 11, 2014, 1:07pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/1 "2014-04-11T13:07:18Z")

</div>

Hi guys,

I am using the GetWorld()-\>LineTraceSingle() function in CPP code to trace some things. It would be very handy for me to actually see some debug lines drawn by an engine, while a tracing happens. In Blueprints, it is easily done with DrawDebugTrace checkbox, which is present in all the tracing nodes. Is it possible to enable it in C++?

---

<div class="post-metadata">

**Author:** ![Br\_P\_d](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/br_p_d/32/918657_2.png) [@Br\_P\_d](https://forums.unrealengine.com/u/Br_P_d)\
**Post date:** [April 11, 2014, 1:22pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/2 "2014-04-11T13:22:12Z")

</div>

Hey, you should be able to do this with the following code:

```
const FName TraceTag("MyTraceTag");

World->DebugDrawTraceTag = TraceTag

FCollisionQueryParams CollisionParams;
CollisionParams.TraceTag = TraceTag;
...
// Use CollisionParamsto perform your line trace

```

---

<div class="post-metadata">

**Author:** ![simmania](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@simmania](https://forums.unrealengine.com/u/simmania)\
**Post date:** [April 11, 2014, 1:30pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/3 "2014-04-11T13:30:10Z")

</div>

[A new, community-hosted Unreal Engine Wiki - Announcements - Unreal Engine Forums](https://wiki.unrealengine.com/Draw_3D_Debug_Points,_Lines,_and_Spheres:_Visualize_Your_Algorithm_in_Action)!

```
DrawDebugLine(
			GetWorld(),
			traceStart,
			hit.Location,
			FColor(255, 0, 0),
			false, -1, 0,
			12.333
		);
```

---

<div class="post-metadata">

**Author:** ![Lordink](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Lordink](https://forums.unrealengine.com/u/Lordink)\
**Post date:** [April 11, 2014, 2:55pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/4 "2014-04-11T14:55:26Z")

</div>

Thanks, it works just fine.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_acbc7c02](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_acbc7c02](https://forums.unrealengine.com/u/anonymous_user_acbc7c02)\
**Post date:** [January 25, 2017, 12:32am UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/5 "2017-01-25T00:32:38Z")

</div>

There’s apparently now a console command, as well. \> TraceTag &ltname&gt

Note that async traces will not call the debug draws, however.

---

<div class="post-metadata">

**Author:** ![ianFisch](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ianFisch](https://forums.unrealengine.com/u/ianFisch)\
**Post date:** [May 29, 2021, 11:11pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/6 "2021-05-29T23:11:00Z")

</div>

I can’t believe they took down the wiki. Probably the worst thing Epic’s ever done.

---

<div class="post-metadata">

**Author:** ![Slapdash85](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Slapdash85](https://forums.unrealengine.com/u/Slapdash85)\
**Post date:** [June 7, 2021, 4:30pm UTC](https://forums.unrealengine.com/t/draw-debug-lines-for-line-tracing/280307/7 "2021-06-07T16:30:01Z")

</div>

It does seem like an astonishingly poor deicison, doesn’t it? It seems like most of the content (maybe all of it?) is still available, but finding it is a right ■■■■■
