question

David Meier avatar image
David Meier asked

OnError isnt working in Unity LogIn Function

Hi guys I was just makin a simple Login function with playfab and than i realized that the on error function in this code isnt working. Here is the Code

using System.Collections.Generic;

using UnityEngine;

using PlayFab;

using PlayFab.ClientModels;

using UnityEngine.UI;

public class Test : MonoBehaviour

{

[Header("UI")]

public Text messageText;

public InputField emailInput;

public InputField passwordInput;

public void RegisterButton()

{

var request = new RegisterPlayFabUserRequest

{

Email = emailInput.text,

Password = passwordInput.text,

RequireBothUsernameAndEmail = false

};

PlayFabClientAPI.RegisterPlayFabUser(request, OnRegisterSuccess, OnError);

}

public void LoginButton()

{

}

void OnRegisterSuccess(RegisterPlayFabUserResult result)

{

messageText.text = "Registered and logged in!";

}

public void ResetpasswortButton()

{

}

void OnPasswordReset(SendAccountRecoveryEmailResult result)

{

}

}

can some of you help me out? THANKS!!!

unity3d
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

Since you didn't have a OnError method in your code, you need to manually implement the OnError callback method.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.