// i am basically trying to use Username as UserId cause username in playfab needs to be unique and also it can't be changed // Generating Username as public static string GetRandomUserId(int _length){ string _id = string.Empty; for (int i = 0; i < _length; i++) { int random = UnityEngine.Random.Range(0,36); if (random < 26){ _id += (char)(random + 65); }else{ _id += (random - 26).ToString(); } } Debug.Log($"UserId = {_id}"); return _id; } public void OnRegisterButton() { // Setting USER_ID String to random 7 digit string string USER_ID = RandomIdGenerator.GetRandomUserId(7); // running user built in Register Func. RegisterUser(USER_ID, EmailInput.Text, PasswordInput.Text); } void RegisterUser(string _Userid, string _email, string _password){ RegisterPlayFabUserRequest request = new RegisterPlayFabUserRequest(); request.RequireBothUsernameAndEmail = true; request.Username = _Userid;// Can't be changed request.Email = _email;// can be updated request.Password = _password;// can be reset PlayFabClientAPI.RegisterPlayFabUser(request, OnRegisterSuccess, OnError); } void OnRegisterSuccess(RegisterPlayFabUserResult result){ Debug.Log("User Registered"); } void OnError(PlayfabError error){ Debug.Log("error.ErrorMessage"); }