Could I get some help with an issue with declaring USpringArmComponent?

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.

Update: GetOuter() replacing this did not work.

I’ve checked the source code for SpringArmComponent.h/.cpp and cannot find bInheritPitch anywhere. I’m working on version 4.1 atm. Were bInheritPitch (and the 6 other variables that are giving me errors) added in 4.1.1+ or 4.2?

Problem solved. Use GetOuter() instead of this in the assignment. Use TSubobjectPtr SpringArm; instead of the version without class.

My issue was that in 4.2 they added TargetOffset, bEnableCameraRotationLag, CameraRotationLagSpeed, bInheritPitch and bInheritRoll. I was attempting to use them and hadn’t realized they weren’t in the version I was using. Upon removal the code compiled fine.