What's the "Professional" way to Initialize Classes?

Dannyyy
Mon, 06 May 2024 09:52:17 +0000
Blueprint

The Goal:
Make sure that all classes are initialized and ready to be used on startup of a new map.

Personal Idea for Class Initialization:
Based on a Reddit Post, the order of class init seems to be:
Game Instance > Game Mode > Game State > Other…

Use the Game State class (normally i would use the Game Mode but I’m working on a multiplayer game and clients don’t have it). Define a bunch of bools for each class inside the Game State to detect if a selected class has been initialized (e.g. “IsHudInit?”). Finally I would cast to the Game State from each class on BeginPlay and set the bool for the selected class variable to true. When all init variables are true, the game would start.

Recommended Method by YouTuber Kekdot:
Show Video (click for more details)
How would you do this professionally?
There might be ways to do init with C++ but I’m only interested in Blueprint based solutions, since I lack the experience. Any better suggestions than what I mentioned above are much appreciated!

3 posts - 3 participants