Hey, so i'm trying to get this result shown here, but as any error message it throws out.
i don't know what else to say/explain so here's my horrid code
using System.Collections; using System.Collections.Generic; using UnityEngine; using PlayFab; using PlayFab.ClientModels; using PlayFab.DataModels; using PlayFab.ProfilesModels; using UnityEngine.UI; using TMPro; public class Register : MonoBehaviour { public TMP_InputField Username; public TMP_InputField Password; public TMP_InputField ConfirmPass; public TMP_InputField Email; public GameObject Error; public TMP_Text ErrText; public void CreateAccount() { if(Password.text == ConfirmPass.text) { RegisterPlayFabUserRequest request = new RegisterPlayFabUserRequest(); request.Username = Username.text; request.Password = ConfirmPass.text; request.Email = Email.text; request.DisplayName = Username.text; PlayFabClientAPI.RegisterPlayFabUser(request, result => { Debug.Log("Account Created with username: " + result.Username + " !"); }, error => { Error.GetComponent<Animator>().Play("Fade-in"); ErrText.text = "Email is not valid example"; // this is supposed to be where playfab returns errors, like "username must be 3 and 20 characters" Debug.Log("some error happened, oops!"); Debug.LogError(error.GenerateErrorReport()); // this generateErrorReport, whatever comes out of this is what I need to show in the text of that window, thanks! }); } } }
Any help would be appreciated! Thanks