Documentation

​
​

Development

User Acquisition

Monetization

Industry

Authentication

Unity SDK

Admin API

Client API

Open Unity Dashboard

Authentication

LiveOps
​
​
Authentication
  • Overview
  • Get started
  • Concepts
    • How Authentication works
    • Approaches to authentication
    • Sessions and cached players
    • Manage profiles
    • Manage player names
    • Manage linked external identities
    • Player prefs
    • Delete accounts
    • Authentication native SDK
    • Digital Services Act Notifications
  • Tutorials
  • Reference
  • Privacy and consent
  1. Unity Authentication

Manage player names

Manage player display names and handle naming updates throughout the player lifecycle.
Read time 2 minutes
Last updated 9 months ago

Minimum SDK version: 2.5.0-pre.3. Ensure you have the right version.
Players can associate a player name with their player ID, providing a customizable and more readable representation of their identity. Player IDs map to exactly one player name, and vice versa.
Note
The player name is completely separate from the username in the Username & Password identity provider.

Setting player name

Players must be signed in to create or update their player name. Use
AuthenticationService.Instance.UpdatePlayerNameAsync(playerName)
. The name should not contain any white space and should have a maximum length of 50 characters. A randomly-generated suffix consisting of a hash and four digits (e.g. #1234) is automatically appended to the requested name.
If the player is not signed in or the request fails to complete successfully,
UpdatePlayerNameAsync
throws a RequestFailedException. If the update fails due to an authentication-specific error,
UpdatePlayerNameAsync
throws an AuthenticationException.

Getting player name

Players must be signed in to get their player name. Use
AuthenticationService.Instance.GetPlayerNameAsync()
. If no player name is found for the player, a random name is returned and assigned to the player.
If the player is not signed in or the request fails to complete successfully,
GetPlayerNameAsync
throws a RequestFailedException. If the get fails due to an authentication-specific error, GetPlayerNameAsync throws an AuthenticationException.

Caching

The player name is cached locally per profile each time
UpdatePlayerNameAsync
or
GetPlayerNameAsync
is called. To access the cached value of the player name, use
AuthenticationService.Instance.PlayerName
. The cached value is cleared after signing in with a new player, signing out, or attempting to call
GetPlayerNameAsync
when no player name exists. If the cached value is not set, accessing it returns null.

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Setting player name

    • Getting player name

    • Caching


Report a problem with this page