How can I provide a proper string for the playfab username?

Viewed 13

I'm making a game in unity but I am having a small problem with the playfab RegisterPlayFabUserRequest: I want to sign up users with a username and a password, this is my code:

public void Register()
    {
        var request = new RegisterPlayFabUserRequest
        {
            Username = username,
            DisplayName = displayName,
            Password = password,
            RequireBothUsernameAndEmail = false
        };
        PlayFabClientAPI.RegisterPlayFabUser(request, OnRegisterSuccess, OnRegisterError);
    }

The displayname, username and password get defined here in the update function:

displayName = displaynameInput.GetComponent<TextMeshProUGUI>().text.ToString();
        password = passwordInput.GetComponent<TextMeshProUGUI>().text.ToString();
        username = displaynameInput.GetComponent<TextMeshProUGUI>().text.ToString();

When i run this, this error pops up (it's from error.GenerateErrorReport() enter image description here

I've read some stuff online and this is what I found: https://community.playfab.com/questions/36762/registerplayfabuser-fails-with-invalid-characters.html There seems to be a problem with TextMeshPro.

Does anyone know how to fix this?

0 Answers
Related