PlayerController Mouse Input

Hey Guys,

I am trying to clamp the rotation of my playerController. I got a PlayerCharacter with the standart PlayerController, which seems to rotate with the mouse.
In my game is a sequence where my character has to follow another character. To make sure that the player follows this character, I want to limit the yaw rotation of the player, so that he can only turn away 20 degree from the direction of the character he follows. Therefore I calculate the angle between the direction of the other character and the direction playerController. Now I want the playerController to stop rotating if the next value will be bigger than my trashhold of 20°.
Any ideas.

Thanks Pascal

Don’t try to handle that on a mouse input level.

Have a look at APawn::FaceRotation, that is where the resulting rotation calculated by the controller are applied to the pawn. You should be able to override it in your own player character class and discard any rotation above your threshold.