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() {
Super::PostInitializeComponents();
}
void ATGPawn::SetupPlayerInputComponent(class UInputComponent* InputComponent) {
check(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.
Specs:
Windows 8.1
12GB Ram
Core i7 processor
Nvidia GTX 470