Syedhs
(Syed)
February 28, 2016, 1:44am
1
Currently I setup the input binding this way:-
void ASimVehicle4W::SetupPlayerInputComponent(class UInputComponent* InputComponent)
{
// set up gameplay key bindings
check(InputComponent);
ASimController* ctrl = Cast<ASimController>(GetController());
ctrl->SetupInputBinding(InputComponent);
}
However, it is much better if I can have it down within Controller, not each of the pawn class. Is there any way?
As some of my pawns are total blueprint class, and having the same code repeated in many class is counter-intuitive…lol
Syedhs
(Syed)
February 28, 2016, 2:05am
2
Anyway, I create a base Pawn class and have every pawn derived from it. And I put the code above in the base Pawn class… solved. Probably this is the best way as I can put other customizations which are common for all pawns in there.
eXi
(Cedric Neukirchen)
February 28, 2016, 3:08am
3
Nothing speaks against adding input events to the PlayerController and handling them there.
But yeah, a base class for your Pawns is also a good solution.