How to view other player stats?

Hello

I use the script to show the player his level

How to show other players level? like lets say they fight 1 vs 1 how to view the other player level?

I though it was an easy question :frowning:

Its network multiplayer?

yes it is multiplayer game

You cast to GameMode to get player level, right? For getting player level, you need to cast Player State. Player state the one, who store player stats like score, name, kills/deaths and other, including level. GameMode store rules of game like time limit, etc. Create a Player state and create variable “Player level”. Then get player state and get level. For widget you need use somethink like that: get owning player pawn → player state → cast to player state → get player level → int to text. Sorry if it has grammar mistakes.

While you can store your variables wherever you want, I agree that keeping each player’s own vars in their own PlayerState makes it easier to manage, because the UMG widgets can then easily tell if they’re accessing the data of the player that owns them in that player’s viewport, or some other player’s data.

I myself have a UMG widget that populates itself with other widgets by cycling through all the GameState → PlayerArray and setting on those smaller widgets which player they should refer to. Then in the display Bind functions, it uses the Player State it was assigned to to get the data it should display, regardless of which player owns it.

I know this is old, but I got this message
( Game State does not inherit from Pawn )

You didn’t try to cast a Pawn to a GameState did you?