In the API I can’t find a way to change the PlayerName I get in LeaderboardEntry.
By default it is set to something like “GaudyComposedGoldfish#7”.
How can I change it? Thanks in advance!
In the API I can’t find a way to change the PlayerName I get in LeaderboardEntry.
By default it is set to something like “GaudyComposedGoldfish#7”.
How can I change it? Thanks in advance!
About to try this out myself: Player name management
Thank you, Alex! I have tested that API a few days ago, and I confirm that it works fine. One detail is that it adds a #random_number at the end every time I update, but it can be fixed with a Split.
Will this allow you to get the names of the other players in the Leaderboard?
I would also like to know if there will be functionality for retrieving names.
It does. The PlayerName that’s part of LeaderboardEntry is the player name that is set from the Authentication Service for that player.
Hi!
Thank you Alex for the answer.
This is correct, setting the player name is now available as part of Authentication package 2.5.
You can now use AuthenticationService.Instance.UpdatePlayerNameAsync(playerName)
to set the player name for Leaderboard.
Hi UnityManuJack,
could you tell us what the format restrictions for the playername are? Are they the same as for the username
or different? Can’t find anything about it. Thanks…
See the documentation on it: https://docs.unity.com/ugs/en-us/manual/authentication/manual/player-name-management
This means that for example this string “#################################################” would be a valid playername? Weird…
Hi UnityManuJack,
the documentation states “Players must be signed in to create or update their player name.” but running
AuthenticationService.Instance.UpdatePlayerNameAsync(playerName)
gives me :
Unity.Services.Authentication.AuthenticationException: Invalid state for this operation. The player is already signing in.