Hello,
I have a PlayerController for my Camera pawn. Within the controller I hook into Event:BeginPlay and the BeginPlay function bootstraps the PlayerController. One of the steps in this bootstrap process is to call my GameState.GetBuildingManager method that returns an Actor instance (Actor instance is used by my HUD buttons), but what’s actually being returned at this time is None/Null. (See my PlayerController below)
The arrow below is pointing to the method that is returning None/Null instead of my Actor. NOTE: I deliberately disconnected the return value of GetBuildingManager() from my call to Create Master HUD Widget for debugging reasons and forgot to reconnect it for the screenshot.
My GameState hooks into Event:BeginPlay too, as a way to bootstrap itself. It’s at this time when it spawns a new BuildingManager actor.
My overall question to get me unblocked is: At which point should I create the BuildingManager object in my GameState so it’s available to the PlayerControllers at Event:BeginPlay? Should I move the BuildingManager Actor initialization to GameState.ConstructionScript()?
I already discovered the event dispatching order for Event:BeginPlay is first triggered on PlayerControllers and then the GameState. At this point I only need to know what event or function will be called only once on the GameState and before PlayerControllers Event:BeginPlay.