How can I create a Static Camera using code?

Hello!

I’m completely new in Unreal (i have experience with other engines) and i’m trying to do a small prototype to start learning how this works. The prototype is the typical asteroids game.

I have tried many ways to create an static camera for the game but still I haven’t found the good one. I can place a cameraActor in the editor, created an actor with a camera component, so i can have more control, and a couple of things more but I haven’t yet the way to say to the engine that my camera is the one i want to use instead of the default temporal one, ore the one it creates in a Pawn when a player possesses it.

I have also tried to create an instance of PlayerCameraManager and do a setViewTarget of my camera, but it makes the game crash.

I suppose i’m doing something completely wrong, so all the help is welcome.

Thanks!

You dont need to create instance of PlayerCameraManager, it is created for each PlayerController (somyou can control camera for each player) by the engine and pointer is helt here

Not to mention SetViewTarget funtion is forwarded to PlayerController and you can call it from there