Download

Cast to Game State Fails...

Any Reason Why Casting to game state from UMG widget fails?

I am calling the create widget from the player controller set to “Owning Client / Reliable” Replication, which was triggered by the game mode. Everything fires but the cast in the UMG fails…

??

So I was reading on the way UNREAL processes the workflow in creating things. and game state is almost last in the flow. SO i added a delay before the calling of creating the widget and thus delaying WHEN it tries to cast, and it seems to be working.

Is this a “hack” or the proper way to implement this?

It’s a hack considering the low level flow. The not hack approach would be to have the Game State notify all controllers its ready, then have the controller create a cast reference for usage.

Got it. Thanks! Ill see how I can trigger this to flow from game mode to state to controller to umg =P

You can achieve the same result by delaying play start (spawning, possessing pawn) until everything is loaded.

Hmmmm How would I do that in tandem with a “onPostLogin” for multiplayer maps?