Where & how should I create managers ?

Hi everyone !
I apologize in advance since I’m pretty sure my question is stupid and has already been asked several times, but there are tons of topics and I feel really lost.

I’m new to Unreal Engine and I want to create a camera system like in adventure games : several cameras attached to walls or to rails, so they are activated when the player is in the right place. In order to command all of these, my will is to implement a singleton “Camera Manager”, from where I could change several global properties for all my cameras in UE’s editor.

I was planning to put a CameraManager as a UObject in my game, but I red some things about Game Modes and it seems a lot of people advices to create the manager classes in it.

Hoping I’ve been clear enough (I doubt :stuck_out_tongue: ), what should I do ?
To create my CameraManager as a UObject as I thought ? Or to manage absolutely everything from my GameMode ?

Thanks

There is actually already a class for just this: PlayerCameraManager: APlayerCameraManager | Unreal Engine Documentation

You can also check out how the Camera is maintained on this page: Camera | Unreal Engine Documentation

By default, the Camera Manger looks for the first attached camera to a Pawn you possess, if you don’t have one, it’ll spawn a ‘CameraActor’ in the world and that will be your viewpoint. The purpose of the Cam Manager is to ensure that a player can always see something, or at least has a viewpoint.

For my own project, I modified this so it uses the Camera in my custom Player Controller class. That way, I can determine what the Camera is attached to and when. I use a ‘GameObject’ Actor Component, which the Player Controller reads from to determine where it should attach. That’s the best way I’ve found, rather than have loads of CameraComponents and spring arms attached to all the objects I might want to view the world through :slight_smile:

I can post code over the weekend if you have no luck.

EDIT: In fact, you’ve given me a topic for my next dev stream :slight_smile: I’ll link it here once I’ve posted.

EDIT #2: Bam: [LIVE STREAM] TheJamsh's Developer & Tutorial Streams! - Community Content, Tools and Tutorials - Unreal Engine Forums

Wow thanks, I didn’t expect such a complete answer.
I think I still don’t totally get the “PlayerCameraManager” class purpose because of a grammar detail : I’m looking for “several cameras” and the documentation says “the player camera” (like it’s the only one).

Anyways, your post helped me a lot ! I’m going to work on it and tell you if I encounter any annoying difficulty. Thanks ! :slight_smile:

And I don’t think I’ll be able to see your stream on Wednesday, but if you save the video, I’m looking forward to seeing it

Ah okay, so do you want to view the world through several cameras at once, or just flick between them as and when you want to?

(Vid will be on YouTube after the stream, I’ll link it here too)

Just flick between them.

In fact, I just realize the best example to quote : Resident Evil 1.
I want cameras to be activated when the player enters a room / walk through a certain trigger. It could be immobile or rotative cameras, or even on rail. I already coded the C++ classes for these camera types.

Oh, I probably found what I was looking for : GameInstance class ^^

There is UBaseManager too, which we use for our general managers :slight_smile: