Rotate Camera C++
I want to rotate camera when game starts with the code below.
Only the code for change location works but SetActorRotation(this->CameraEntryLocation) does not work. How can I fix this?
asked Jun 04 '18 at 01:34 PM in C++ Programming
"ViewTarget" is actor that is currently display. The way it is work is, on every frame PlayerCameraManager ask ViewTarget (a actor) by calling it's function CalcCamera() to get camera position, so it kind of like asking how actor which to be displayed:
The default code inside AActor class CalcCamera searches for active camera components inside the actor and it gives out world position of first active camera component inside Actor, so by default location of camera component inside the actor controls camera view. You have 2 options:
-Either change position and rotation of camera component (or place camera component if it's missing) inside ViewTarget actor
-Or override CalcCamera function of Actor you use as ViewTarget to manually output camera positioning
Note that by default Possessed actor by PlayerController automaticly becomes ViewTarget, you can disable this behavior by setting bAutoManageActiveCameraTarget to false in PlayerController
Follow this question
Once you sign in you will be able to subscribe for any updates here