# Debugmessage nullpointer?!

**URL:** <https://forums.unrealengine.com/t/debugmessage-nullpointer/331601>\
**Category:** Debugging, Optimization, & Profiling\
**Tags:** debug, unreal-engine, question\
**Created:** [September 9, 2015, 4:54pm UTC](https://forums.unrealengine.com/t/debugmessage-nullpointer/331601 "2015-09-09T16:54:16Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Nsomnia](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nsomnia](https://forums.unrealengine.com/u/Nsomnia)\
**Post date:** [September 9, 2015, 5:37pm UTC](https://forums.unrealengine.com/t/debugmessage-nullpointer/331601/2 "2015-09-09T17:37:15Z")

</div>

You need to have UE\_BUILD\_DEBUG as your build type for that line to work and

```
 #if UE_BUILD_DEBUG
     GEngine->AddOnScreenDebugMessage(-1, 2.0f, FColor::Red, "Some Message");
 #endif

```

would be the proper way

Generally messages to the screen are printed something like this

```
 UE_LOG(MyGame, Log, TEXT("Some Messsage") );

```

I highly reccomend reading Ramas post about debugging and printing messages here

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Hope this helps  
_Don’t forget to accept an answer that best clears your question up or answers it so when the community finds your question in the future via search/google they know exactly what you did to fix it/get it going._

---

_[View the full topic](https://forums.unrealengine.com/t/debugmessage-nullpointer/331601)._
