When/Where is it safe to create GUI [multiplayer]?
Where/when is it safe to create the GUI (widgets) in multiplayer for both dedicated and non-dedicated games? So far I was able to find this solution (it works) but it's hacky and OnRep_Pawn() is called more than once for clients, so not very ideal.
So where is the function that I need to override (or event) where I can create my GUI-widgets knowing 100% sure (to prevent nullptr crashes) that the Pawn&PlayerController for that player have been created and that the player successfully logged in?
Do it where you feel it is appropriate. You just want to use IsLocallyControlled() in an if-statement to be sure the HUD code will only run on the owning client. With that and a few other functions, you can put role-specific code in places that run on all roles (i.e. HasAuthority()).
answered Jan 20 '18 at 03:45 PM
You could just create the widgets in the player controlller code. When each player logs in it will execute the code on that specific player.
answered Jan 20 '18 at 09:03 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here