Download

How can I access to a custom CameraComponent , in my Pawn character Blueprint class?

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.

f7b10213032265073345d8ec1bed476b60cd4248.jpeg