Local Multiplayer Character UMG Widget

Hi Everybody,

I have a local multiplayer game, where each player character has a widget component attached above their head. The idea is that the widget has text that will be populated whenever they walk over something they can interact with.

The text in the widget is bound to a function as shown below:

The this function get a text variable from the character to populate. It works when there is one player, but when a second player enters the game, it doesn’t.

What happens is that the text is not affected by the second characters variable, but rather, whatever should only be shown above the first players head is duplicated for all the players in the game. I know it has something to do with the “Get owning Player Pawn” section of the blueprint, but as I am new to using UMG’s I am not sure how to proceed.

Thanks for any help in advance!

Hello

You are only getting the variable of one player pawn with that as far as i know. Instead of setting your text in your widget, I would try setting your popup text in your PlayerCharacterBase itself - you should have a reference over there anyways.

Hope that helps

Hi Mar,

That is actually what I am doing. The blueprint you see above is just linking the UMG text binding to a variable within the player character called “Popup text”.

I have attached a print string to the function within the player character that updated the popup text, so I know the variable is being populated separately for the individual players. The image above just somehow is only getting updated from player index 0.

Ok so by looping through all players in my scene (2) i was able to set the text to their respective player controller. I did this in the level editor though so its not the best yet.

134737-test1.png

Wow, thanks for doing this.

Although it doesn’t quite answer my problem. My issue is happening in a third person game scenario, where the UMG, rather then being something attached to viewport, is a widget component floating above the players head. Hence why I thought “get owning player pawn” would work, as the component exists directly within character.

Sorry if I wasn’t clearer earlier.

I’m having similar trouble only with floating progress bars changing to the same value for all players when changed on the listen server’s player, even though the variable they’re bound to is different.