I want an actor to have some debugging going on based on user input.
I tried this:
ADisplayOut::ADisplayOut(const FObjectInitializer& objInitializer):
Super(objInitializer)
{
bFindCameraComponentWhenViewTarget = true;
AutoReceiveInput = EAutoReceiveInput::Player0;
PrimaryActorTick.bCanEverTick = true;
mInputComponent = objInitializer.CreateDefaultSubobject<UInputComponent>(this, "InputComponent");
}
void ADisplayOut::PostInitializeComponents()
{
Super::PostInitializeComponents();
AMainGameState::SetDisplay(this);
if (NULL != mInputComponent)
{
mInputComponent->BindAction("MoveOutputRight", EInputEvent::IE_Pressed, this, &ADisplayOut::OnMoveMonitorsToSide);
}
}
The action gets bound, but the function is never called.
I tried Enabling input in several places (BeginPlay, Pre/Post initialize components).
Furthermore, this specific input is not consumed by the main pawn.
I Also tried to bind the ‘InputComponent’ that comes with the actor, but this gets NULLed after construction.