InputComponent and Actors

First, just to handle my programmer obsessiveness:


APlayerController* PlayerController = Cast<APlayerController>(GetWorld()->GetFirstPlayerController()->GetPawn()->GetController());

Is an awful lot more work than is needed.


APlayerController* PlayerController = GetWorld()->GetFirstPlayerController();

Is identical functionality. Controller->GetPawn()->GetController() is just going to be Controller.

Ok … sorry. Now back on topic. In general your setup looks sound. When you’re in game you can also do a console command “showdebug input” which will display the current input stack. The most common cause of something like this would be that something else is consuming the key press before it makes it to your Actor.

The second idea is that the BeginPlay on the Paddle is somehow happening before APlayerController::InitInputSystem is getting called and so the input stack is getting cleared. If you have full code you could put a breakpoint at the point you push your component on to the stack and inside InitInputSystem and be sure it isn’t getting called in an unfortunate order.