Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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++) ?

    Code:
    
    #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.



    Click image for larger version

Name:	CameraComponent.JPG
Views:	1
Size:	79.6 KB
ID:	1143202
    MSD
Working...
X