AddPitchInput not applying AxisValue

So I have a player controller coded in C++ and everything was working just fine until I updated to version 4.5.1. now all character actors using this controller class have all movement input working except for pitch. The roll (keyboard A and D), moveforward (keyboard W and S) and yaw (Mouse Axis X) work just fine, but the pitch input will not change the camera pitch. i have made sure that the camera component bUseControllerViewRotation is true, removed and readded the LookUp axis value in the input section of the editor as well as from the code itself, removed all slate widgets from the HUD class and confirmed that the delegate bound to my character’s LookUp function executes at least to the “AddControllerPitchInput(axisValue);”

I can make absolutely no sense of this, as the Yaw works just fine and all of the documentation seems to indicate that if one should fail, so should the other.

Two possible culprits:

  1. my serialized settings class has an “Invert Y axis” setting, but I have run this in editor with a value set and it still does the same thing.

  2. my game mode switches between 3 different HUD classes depending on the type of character. but on top of having no idea how this would only cancel out the Y axis input, this setup was working fine in 4.4.3.

so i’m just gonna throw this out there.

Does anyone have any ideas what could cause this?

After tearing apart my entire project, i found that for some reason, the two following changes need to be made for the Y axis to function properly:

  1. in the header file, the camera component needs to be changed from

    TSubobjectPtr< UCameraComponent> MyCamera;

to

TSubobjectPtr<class UCameraComponent> MyCamera;

then, in the constructor, after the camera component is initialized, you have to set the bUsePawnControlRotation property to true like so:

AddComponent(FName("UCameraComponent"), true, FTransform(FVector()), MyCamera);
	MyCamera->bUsePawnControlRotation = true;

Not sure why this works, but hopefully this can be a quick fix for anyone who comes across the same problem.

<3