C++ Debug text and Debug lines in construction script
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?
asked Sep 24 '18 at 10:24 PM in C++ Programming
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
Also, while our new wiki is under construction, this page contains many useful references for how to create logs and print messages in c++
I hope you find this useful!
answered Sep 25 '18 at 07:36 PM
NicholasMont ♦♦ STAFF
Follow this question
Once you sign in you will be able to subscribe for any updates here