# Construction Script Draw Debug Line

**URL:** <https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** debug-draw, unreal-engine, construction-script, editor, Blueprint, question\
**Created:** [February 15, 2015, 7:45am UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001 "2015-02-15T07:45:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![DevilsD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devilsd/32/890854_2.png) [@DevilsD](https://forums.unrealengine.com/u/DevilsD)\
**Post date:** [February 15, 2015, 7:45am UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/1 "2015-02-15T07:45:06Z")

</div>

I need to be able to draw a debug line between 2 points indefinitely within the construction script so that i can see it within the editor when I’m not in Play Mode.

Does anyone have any idea how to do this besides setting the duration to a high number?

Setting duration to -1 or 0 doesn’t work either.

If there is a better way to visualize a connection between 2 points indefinitely within the editor then im all ears.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_17ec24a01](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_17ec24a01](https://forums.unrealengine.com/u/anonymous_user_17ec24a01)\
**Post date:** [February 15, 2015, 1:33pm UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/2 "2015-02-15T13:33:08Z")

</div>

you might have better luck using an arrow component extending between the two points in space.

---

<div class="post-metadata">

**Author:** ![Kilrogg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kilrogg](https://forums.unrealengine.com/u/Kilrogg)\
**Post date:** [February 15, 2015, 4:33pm UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/3 "2015-02-15T16:33:02Z")

</div>

Just put the duration to a very high number like 9999. I do this with many of my blueprints and it hasn’t caused any issues.

Just make sure you put a Flush Persistent Debug Lines node at the beginning of your construction script so it removes the old debug lines every time it runs instead of stacking them.

---

<div class="post-metadata">

**Author:** ![DevilsD](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/devilsd/32/890854_2.png) [@DevilsD](https://forums.unrealengine.com/u/DevilsD)\
**Post date:** [February 16, 2015, 5:11am UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/4 "2015-02-16T05:11:40Z")

</div>

This might be a nice option.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_88d1d487](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_88d1d487](https://forums.unrealengine.com/u/anonymous_user_88d1d487)\
**Post date:** [July 21, 2015, 10:05am UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/5 "2015-07-21T10:05:39Z")

</div>

Increasing the duration works.

---

<div class="post-metadata">

**Author:** ![Nonrandom](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nonrandom](https://forums.unrealengine.com/u/Nonrandom)\
**Post date:** [August 15, 2015, 5:05am UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/6 "2015-08-15T05:05:13Z")

</div>

The problem with using a high duration and Flush Persistent Debug Lines is that it limits you to seeing exactly one instance of your blueprint as construction will make all other instances invisible, as well as any other blueprints that use the same method.

I recently ran into this same issue and ended up building a C++ side component with a matching FComponentVisualizer. I later found out that I could have also built a C++ component and matching FPrimitiveSceneProxy. The distinction is important as FComponentVisualizers only draw when the object is selected while FPrimitiveSceneProxys can be set to at all times or just when the object is selected.

---

<div class="post-metadata">

**Author:** ![GeekToBe](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@GeekToBe](https://forums.unrealengine.com/u/GeekToBe)\
**Post date:** [February 23, 2018, 1:31pm UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/7 "2018-02-23T13:31:13Z")

</div>

Thanks it’s that ! “Flush Persistant Debug Lines” ! So happy thanks ! Works for my “Draw Debug Box”.

Have fun !

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_3ae0505e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_3ae0505e](https://forums.unrealengine.com/u/anonymous_user_3ae0505e)\
**Post date:** [March 11, 2018, 9:40pm UTC](https://forums.unrealengine.com/t/construction-script-draw-debug-line/307001/8 "2018-03-11T21:40:19Z")

</div>

As noted by +nonrandom’s answer, this technique only works for one active instance of the blueprint. As soon as you have two of them, adjusting one will erase all lines for all others.
