UGS Leaderboard: Player Name Showing as "Unknown" Instead of Saved Name in Unity Cloud

Hi everyone,

I’m using Unity Gaming Services (UGS) Leaderboards for my 2D game (Unity version 6000.0.26f1), and I have an issue with displaying player names.

  • When a player enters their name, it is successfully saved in Unity Cloud under the Metadata column.
  • The scores are also saved correctly.
  • However, when I try to retrieve and display the leaderboard in Unity, the names are showing as “Unknown”, while the scores appear correctly.
  • The player names are stored inside Metadata (as seen in Unity Cloud).

My Questions:

  1. Is it possible to retrieve player names from the Metadata column in UGS?
  2. If so, how can I correctly extract and display the names in Unity?
  3. Are there any limitations on fetching data from Metadata for the leaderboard?
  4. I’ve tried multiple approaches, but I can’t seem to get the names to display. Has anyone faced this issue before?

Any help or guidance would be greatly appreciated. Thanks in advance!


Hi there,

Examples of how to get back Metadata for scores is can be found in the Unity SDK documentation for Leaderboards.

For example:

public async void GetScoresWithMetadata(string leaderboardId)
{
    var scoreResponse = await LeaderboardsService.Instance
        .GetScoresAsync(
            leaderboardId,
            new GetScoresOptions { IncludeMetadata = true }
        );
    Debug.Log(JsonConvert.SerializeObject(scoreResponse));
}

Note that if you are storing a property named PlayerName in score Metadata on a Leaderboard, that will be distinct from the Player Name associated with the Player account, which you could use instead. Support for Player Names is built in to other Unity services like Leaderboards, Friends, etc.

You can get and set Player Names using the Authentication SDK.

Best regards,

Iain Collins

OMG it’s functioning. thank you so much for your reply!!!

1 Like