Using a PlayerCameraManager to keep a same camera while changing Pawns
Hello, I have made rolling balls pawns using the Rolling Ball default template, except the camera works slightly differently. It follows the movements of the mouse. I'd like to separate the camera from the pawns entirely using a player camera manager, In such a way that a camera is always following whichever pawn is presently controlled by the player controller. With my present system, when I switch pawns, the old pawn and its camera is destroyed, and the new pawn and its camera are then spawned, resetting the camera.
I have had trouble finding information and examples of how to use a player camera manager.
Here is the PlayerController code used to switch pawns. Also, the two pawns are different blueprints of a same class.
Anyone knows how to work with Camera Managers? Thanks in advance! Please, don't hesitate to ask me for more details if I forgot something important.
There no need call anything in PlayerCameraManager, you can just use PlayerController. First you need to set
View target is a actor that is viewed in camera and each actor can have it's own camera setup. When Actor is view target, PlayerCameraManager asks that actor for camera positioning on every frame, by calling CalcCamera which has struct as a argument in which set camera position in (you don't return anything):
Default code in CalcCamera, picks first found camera component and apply position of that component as a camera. Also there no point of calling Super::CalcCamera here ofcorse
Follow this question
Once you sign in you will be able to subscribe for any updates here