Hello everyone, I am having difficulties declaring and using USpringArmComponent.
My declaration in the .h file is
UPROPERTY(Category=Camera, VisibleDefaultsOnly, BlueprintReadOnly)
TSubobjectPtr<USpringArmComponent> SpringArm;
I’ve tried a variant that has class before USpringArmComponent on the second line, that did not work.
In the header file I am including "GameFramework/SpringArmComponent.h, in the cpp file where I am trying to use this I am including the appropriate .h file where the variable was declared.
I am assigned the SpringArm a value like so:
SpringArm = PCIP.CreateDefaultSubobject<USpringArmComponent>(this, TEXT("SpringArm0"));
But when I attempt to use the SpringArm in any form like:
SpringArm->bInheritPitch = false;
I get various errors like (from the output window, the visual studio errors basically say the same thing):
1>E:\omega_bush_2\Source\omega_bush_2\PlayerPawn.cpp(20): error C2039: 'bInheritPitch' : is not a member of 'USpringArmComponent'
1> E:/Unreal_Engine/Engine/Source/Runtime/Engine/Classes/GameFramework/SpringArmComponent.h(15) : see declaration of 'USpringArmComponent'
I was wondering if anyone that has some success using USpringArmComponent could chime in. The only thing I can think of that may be incorrect is the initializer list on the constructor but I’m not really sure what would need to go there.