Hey I am pretty knew and have tried finding a simple answer to this in the forums but haven’t been able to. If someone can help by looking at my code I would greatly appreciate it.
Scenario:
I want to create a controller actor that handles all of my pawns movements. So all of my Axis mapping and functions are in my controller files. This is what some of my code looks like :
void ABasePlayerController::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
//bind inputs here
PlayerInputComponent->BindAxis("MoveForward", this, &ABasePlayerController::MoveForward);
PlayerInputComponent->BindAxis("MoveRight", this, &ABasePlayerController::MoveRight);
}
//axis functions
void ABasePlayerController::MoveForward(float AxisValue)
{
ABasePawn* ControlledPawn = Cast<ABasePawn>(GetPawn());
ControlledPawn->AddMovementInput(GetActorForwardVector() * AxisValue);
I get an error after trying to compile that says:
'AController::GetActorForwardVector': cannot access private member declared in class 'AController'
Im not really sure what that means and how to fix it. Also, Im not really sure if this is the correct way to bind inputs from a controller to a pawn. Let me know if you can help
Thank you in advance!