I am trying to find the equivalent of this in C++:
I don’t know what I’m doing wrong exactly. I tried using the AddActorLocalRotation and AddActorWorldRotation functions from the PlayerCameraManager as well as trying the solution from [this][2] topic and then attempting to use the AddLocalRotation, AddRelativeRotation, and AddWorldRotation functions on the UCameraComponent reference that I found but none of these things made the camera rotate. Am I missing something here?
I found the solution to the issue thanks to another community member pointing me in the right direction. My Default Pawn class is a character class named TPlayer.
First of all, in the header file for TPlayer, I included the UGameplayStatistics header file:
Next I created two pointers to reference the character and the camera component:
After this I assigned their values:
And finally I can rotate the camera like so:
I hope this answer can assist other people in the future that ran into the same issue or a similar one.
1 Like