[4.14] USpringArmComponent from c++ Pitch Problem

I have just updated my project to 4.14.

I have noticed that when the character looks up or down (pitch movement from controller) the camera spins out of control. It only happens when the pitch is at -90º or +90º angle.

This is within the constructor of the character:

AMainCharacter::AMainCharacter() : Super()
{
...
    SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("SpringArm"));
    SpringArm->SetupAttachment(GetMesh());
    SpringArm->bUsePawnControlRotation = true;
    SpringArm->SetRelativeRotation(FRotator(0.0f, 0.0f, 0.0f));
    SpringArm->TargetArmLength = 150.0f;
    SpringArm->SetRelativeLocation(FVector(-30.0f, 0.0f, 170.0f));//on the right shoulder
    
    ThirdPersonCamera = CreateDefaultSubobject<UCameraComponent>(TEXT("ThirdPersonCamera"));
    ThirdPersonCamera->SetupAttachment(SpringArm);
...
}

The input:

void AMainCharacter::SetupPlayerInputComponent(class UInputComponent* InputComponent)
{
...
    InputComponent->BindAxis("LookUp", this, &APawn::AddControllerPitchInput);
...
}

I have uploaded a sample video here:

Many Thanks.

Cheers,
B

**Edit:

I have uploaded an example project and a video to follow:

Project: https://drive.google.com/file/d/0B9mTKNVKB4jdcm1JRkRwcnpCYnc/view?usp=sharing

Video: - YouTube

I hope this helps.

Hello Bullyproof,

I tried reproducing this by editing a C++ project based off the Third Person Template to match the code that you’re using but I’m not seeing the same results. One thing I did notice as odd is that the following line didn’t seem to do anything, no matter what I set the values to:

CameraBoom->SetRelativeLocation(FVector(-30.0f, 0.0f, 170.0f));//on the right shoulder

But I also tried manually moving the CameraBoom (SpringArm) to the right shoulder and still didn’t see the behavior shown by your video.

Could you try to see if you can get this to reproduce in the Third Person Template or at least using the same SK_Mannequin asset?

Hi,

Thanks for your reply.

I have uploaded an example project and a video to follow:

Project:
https://drive.google.com/file/d/0B9mTKNVKB4jdcm1JRkRwcnpCYnc/view?usp=sharing

Video

I hope this helps.

Many thanks

Cheers,
Javier

Thank you for that project, Bullyproof.

It seems that the issue is much more apparent when you’re also turning the character with the same input as you’re using the turn the spring arm. It also seems to be reliant on the camera’s position too. I was able to get this to reproduce in the base Third Person Character project as well, but a lot less consistently.

I’ve placed a bug report in for this issue which you can find here; UE-38811. You can use that link to track the issue itself.

Have a nice day!

Many Thanks :slight_smile:

Have a nice day too.