Download

Allow the pawn to control camera rotation via code

Hi everybody,

I’m new to Unreal Engine and just started with some tutorials. I already noticed they’re quite outdated, and now I’m stuck in one of the steps of the FPS tutorial. in this step:
https://docs.unrealengine.com/en-us/Programming/Tutorials/FirstPersonShooter/2/7

It’s telling me to add the following code to my Character:



**FPSCameraComponent->bUsePawnControlRotation = true;**

Where FPSCameraComponent is a UCameraComponent created via CreateDefaultSubobject. This variable can only be changed in the editor because it’s not public anymore, and it doesn’t have any setter. Checking UCameraComponent code I only found the deprecated bool bUseControllerViewRotation_DEPRECATED which doesn’t work in newer versions Is there any workaround for this step that I’m missing? Many thanks in advance