How I can check that playername is already taken?

Hi, I am making a mobile game and using the Authentication service to allow players to register accounts with a username and password. The issue is that I want the player’s name to be unique, but it seems Unity allows players to have the same and only differ in suffixes.

So, I’d like to ask if there’s a way for me to check whether the playername a player wants to register already exists or not? Thank you in advance!

Hi gin1912,

Great question! When players register an account using Username/Password, their username must be unique in order for them to register successfully. If the username already exists, the sign-up process will return an error.
Here is our docs page for more info about Username/Password:
https://docs.unity.com/ugs/en-us/manual/authentication/manual/platform-signin-username-password

Player Names is a separate feature that allows users to associate a player name to their player ID. This feature automatically generates the suffix at the end of the player name.

Unfortunately, to check whether a player name already exists, the suffix must be provided as well. We currently do not support player name checks without the suffix provided.
For more information about Player Names, please check out this page:
https://docs.unity.com/ugs/en-us/manual/authentication/manual/player-name-management

One possible solution for you has been raised in this forum post:

By using Cloud Save, you could save the user’s player name as an entry. This way if another player decides to use the same player name, a comparison could be made using a Cloud Save query which would return back if the entry does or does not exist. If the player name exists, you could then provide an error to the user instructing them to choose a different player name.

Hopefully that helps, and please feel free to reach out if you have any other questions!

Hi sakariw,

Thank you for your reply, I will research about Cloud Save and Cloud Code. Hopefully in the future, this feature will be updated to make it easier to use!

1 Like

Hi! Did you find a solution? I’m currently looking for a solution for this.