Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We’re making changes to the Unity Runtime Fee pricing policy that we announced on September 12th. Access our latest thread for more information!
    Dismiss Notice
  3. Dismiss Notice

Resolved How to change the PlayerName in LeaderboardEntry

Discussion in 'Leaderboards' started by salavideoclase7, Mar 26, 2023.

  1. salavideoclase7

    salavideoclase7

    Joined:
    Jul 8, 2022
    Posts:
    2
    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!
     
  2. AlexGalbraithCF

    AlexGalbraithCF

    Joined:
    Aug 27, 2021
    Posts:
    8
  3. salavideoclase7

    salavideoclase7

    Joined:
    Jul 8, 2022
    Posts:
    2
    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.
     
  4. Evil-Otaku

    Evil-Otaku

    Joined:
    Oct 17, 2012
    Posts:
    65
    Will this allow you to get the names of the other players in the Leaderboard?
     
  5. BlindsidedGames

    BlindsidedGames

    Joined:
    Aug 24, 2020
    Posts:
    9
    I would also like to know if there will be functionality for retrieving names.
     
  6. Evil-Otaku

    Evil-Otaku

    Joined:
    Oct 17, 2012
    Posts:
    65
    It does. The PlayerName that's part of LeaderboardEntry is the player name that is set from the Authentication Service for that player.
     
  7. UnityManuJack

    UnityManuJack

    Unity Technologies

    Joined:
    May 30, 2019
    Posts:
    11
    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
    Code (CSharp):
    1. AuthenticationService.Instance.UpdatePlayerNameAsync(playerName)
    to set the player name for Leaderboard.