Currently writing my own pawn movement component to get around the fact that you can only use capsule collision for UCharacter, and I’m stuck om how to rotate the spring arm.
There is no issue with yaw rotation, since I can simply turn on “Use Pawn Control Rotation” to get the spring arm to inherit the pawn’s rotation, but since my pawn doesn’t change it’s pitch this method obviously doesn’t work.
I looked at how this is done in UCharacterMovementComponent and as far as I understand the pitch of the actual character is changed, which the spring arm then inherits, but this can’t be correct because the character does in fact stay vertical.
I could change the rotation of the spring arm directly via SetRelativeRotation(), but this doesn’t feel like a clean method to use, especially considering it doesn’t seem to be used in UCharacterMovementComponent.
AddControllerPitchInput() only adds input to the player controller. I then have to write logic for what happens with that input in my movement component. For the yaw I can just rotate my pawn according to the controller rotation, but I don’t want to change the pitch of my pawn.
Ok, thank you. Still don’t get how it is done in UCharacterMovementComponent though. It really looks like they update the pitch of the character itself, which is weird.
I was under the impression that when you enabled bUsePawnControlRotation on the spring arm, it inherits the actual rotation of the actor it is attached to. I should have looked more closely at the name of the actual variable though, because it does in fact inherit the control rotation of the pawn, which is updated by AddControllerPitchInput() as @Tuerer suggested I use.
Feeling kinda stupid right now, but apparently I don’t have to do anything other than enabling bUsePawnControlRotation, bInheritPitch, and bInheritYaw.