Hello all,
I am currently trying to get the spring arm component from a pawn using an input controller. I get the actor using:
//Get the pawn
APawn* Pawn = Cast<APawn>(this->GetPawn());
Which appears to work fine, but upon trying to get the spring arm, a child of the pawn, I tried using these two methods of getting it.
//Method 1
TArray<class USpringArmComponent> SpringArm;
SpringArm = Pawn->GetComponents<USpringArmComponent>();
//Method 2 as there is only 1 spring arm
class USpringArmComponent* BoomArm = FindComponentByClass<USpringArmComponent>();
Method 1 returns an error of “pointer to incomplete class type is not allowed”, and method 2 returns a statement from the engine saying it may only be called from an actor.
I’m doing this to try and create a pinch to zoom function for touch screen computers.