# C++ Debug text and Debug lines in construction script

**URL:** <https://forums.unrealengine.com/t/c-debug-text-and-debug-lines-in-construction-script/434427>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** construction, unreal-engine, print-string, CPP, question\
**Created:** [September 24, 2018, 10:24pm UTC](https://forums.unrealengine.com/t/c-debug-text-and-debug-lines-in-construction-script/434427 "2018-09-24T22:24:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![theNewGfactor](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@theNewGfactor](https://forums.unrealengine.com/u/theNewGfactor)\
**Post date:** [September 24, 2018, 10:24pm UTC](https://forums.unrealengine.com/t/c-debug-text-and-debug-lines-in-construction-script/434427/1 "2018-09-24T22:24:33Z")

</div>

Hello, I’ve just started programming in C++ and can’t figure out how to print debug text on screen and debug lines in world in my C++ construction script (OnConstruction). In blueprints, you can call “Print String” and “Draw Debug Line”. Both of these work in the construction script while the game is not running.

The C++ equivalent for “Print String” appears to be “GEngine-\>AddOnScreenDebugMessage()”, but this only works in runtime since it requires a world context. The alternative is UE\_LOG, but this prints to the output log rather than the screen which for me is more user friendly.

Is there a way in C++ to get the exact same functionality as the blueprint’s version of “Print String” and “Draw Debug Line” which works in the construction script?

Many thanks!

---

<div class="post-metadata">

**Author:** ![NicholasMont](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@NicholasMont](https://forums.unrealengine.com/u/NicholasMont)\
**Post date:** [September 25, 2018, 7:36pm UTC](https://forums.unrealengine.com/t/c-debug-text-and-debug-lines-in-construction-script/434427/2 "2018-09-25T19:36:58Z")

</div>

Hey NfEWg1517,

You can look at the c++ implementation of most blueprint nodes through the api.

Here is a link to the API documentation on PrintString: [UKismetSystemLibrary::PrintString](http://api.unrealengine.com/INT/API/Runtime/Engine/Kismet/UKismetSystemLibrary/PrintString/index.html)

Also, while our new wiki is under construction, this page contains many useful references for how to create logs and print messages in c++

[https://wiki.unrealengine.com/Logs,\_Printing\_Messages\_To\_Yourself](https://wiki.unrealengine.com/Logs,_Printing_Messages_To_Yourself_During_Runtime)

I hope you find this useful!
