How do i spawn and add a UMG widget on the Client ?

Hi ! I want to have a User Interface where the player can see his health etc. First i tried setting up the UMG widget in the Begin Play of the Player. This worked fine until i realized that every player gets a UMG widget too. Meaning every player has 2 of the exact same widgets on top of the other. I tried spawning the widgets localy using the Is Local controlled node. This has the result that only the Server got a widget but not the clients. I also tried spawning the widgets in the gamemode blueprint. This dosent work ether because the UserInterface Widget needs a reference to the player. And get owner just returns null on the clients. So what else can i do ? Or am i doing something wrong here ?

73126-1.png

Try this instead, it should work on the clients. That’s an ‘equals (object)’ node.

http://puu.sh/mlRb4/9dffe85747.png

isnt player controller 0 always the server `?

No. Player controller 0 is always the local player, unless it’s a dedicated server and then it’s the first player to join. Player controllers are only replicated to their owning clients, so on clients, local player controllers are always index 0. On listen servers, index 0 is the local player because it’s the first to join.

I tried it. Player Controller 0 is the server. It just returns none on the client. I tried this to get a reference to my Inventory Widget wich i need.