Hi, I'm trying to write a simple C# script in Unity which allows a user to change their display name but throw up an error if the display name has already been used by someone else. This what I've got so far:
public class StorePlayerName : MonoBehaviour { public string _displayName; public GameObject _inputField; [SerializeField] private TMP_Text _userName; public void StoreName() { _displayName = _inputField.GetComponent<TMP_Text>().text; _userName.text = _displayName; PlayFabClientAPI.UpdateUserTitleDisplayName(new UpdateUserTitleDisplayNameRequest { DisplayName = _displayName }, result => { }, error => { Debug.Log("DISPLAY NAME ALREADY USED"); Debug.LogError(error.GenerateErrorReport()); }); } }
With the above I can change all the user's display names but they can also all be the same name with no issues, which obviously isn't what I want.
Also, 'allow non-unique player display names' is also turned off in my game settings.
Any help greatly appreciated! Cheers