Debug messages don't show in selected viewport, but do show in new editor window

In my pawn I have the following code:

 #include "TextGame.h"
 #include "TGPawn.h"

 ATGPawn::ATGPawn(const class FPostConstructInitializeProperties& PCIP)
      : Super(PCIP)


 void ATGPawn::PostInitializeComponents() {

 void ATGPawn::SetupPlayerInputComponent(class UInputComponent* InputComponent) {
      InputComponent->BindAction("MoveD", IE_Pressed, this, &ATGPawn::MoveDown);

 void ATGPawn::MoveDown() {
      GEngine->AddOnScreenDebugMessage(-1, 5.f, FColor::Yellow, "TGPawn - Move down called");

The on screen debug message only appears if I play in a new editor window. It doesn’t show if I play in the selected viewport. I tested my MoveD action mapping with blueprints and it worked just fine.

Edit: I just discovered that if I click the window first, the message appears. I feel dumb now.

Branch: binary build

Build version: 4.5.1-2336687

Occurs 100% of the time.


Windows 8.1

12GB Ram

Core i7 processor

Nvidia GTX 470

Hi Kochab,

As you noted, you need to click once inside the Editor window when you begin PIE in order for that window to become active. It does not receive any inputs until you make that click.