Hi Guys;
I have a Pawn character Blueprint class , and I add a Camera-Component to it.
My Camera-Component variable’s name is “ESCamera”.
So, How can I find and access to this variable (sub-component) in my Pawn cpp class (C++) ?
#include "SandBox_01.h"
#include "ESPPawn.h"
AESPPawn::AESPPawn(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
void AESPPawn::SetupPlayerInputComponent(UInputComponent* InputComponent)
{
// set up gameplay key bindings
InputComponent->BindAxis("MoveForward", this, &AESPPawn::MoveForward);
InputComponent->BindAxis("MoveSide", this, &AESPPawn::MoveSide);
InputComponent->BindAxis("Turn", this, &AESPPawn::AddControllerYawInput);
InputComponent->BindAxis("LookUp", this, &AESPPawn::AddControllerPitchInput);
}
void AESPPawn::MoveForward(float FWDValue)
{
if ((Controller != NULL) && (FWDValue != 0.0f))
{
HERE IS WHERE I WANT TO ACCESS THAT VARIABLE ...
}
}
...
Thanks.