Hey all, I am looking for some clarity on the following code:
What I want to know is.. is there a way to cut out the member functions in the player controller and just call the function from the player controller straight to the player pawn.
I have tried :
or variants of.
where playerpawn is a reference to the possessed pawn.
Bascially I want to not have to call 2 functions for one input read. Thanks in advance !
Code:
InputComponent->BindAction("FirePrimary", IE_Pressed, PlayerPawn, &AShipPlayerController::FirePrimary); InputComponent->BindAction("FireSecondary", IE_Pressed, PlayerPawn, &APlayerShip::FireSecondary); void AShipPlayerController::FirePrimary() { //UE_LOG(LogTemp, Warning, TEXT("FirePrimary Called from player controller")); PlayerPawn->FirePrimary(); }
I have tried :
Code:
InputComponent->BindAction("FirePrimary", IE_Pressed, PlayerPawn, PlayerPawn->FirePrimary);
where playerpawn is a reference to the possessed pawn.
Bascially I want to not have to call 2 functions for one input read. Thanks in advance !