hey, this is my first time using playfab. i am trying to create an account and then retrieve the account information but it fails on the first try. i can retry and get the account information. i am new at this and i dont understand why i am getting an exception. i am successfully logging in after createing an account. when i try to get the payload for the first time is when i get the error. there are other buttons in the program that i can hit to get the account information and they are successful. the buttons simply call the GetAccountInfo function. here is my code and errors that i receive. i am assuming that this is the correct forum to ask. any help would be aprreciated. thanks.
private static AccountInfo instance;
public static AccountInfo Instance
{
get { return instance; }
set { instance = value; }
}
[SerializeField]
private GetPlayerCombinedInfoResultPayload info;
public GetPlayerCombinedInfoResultPayload Info
{
get { return info; }
set { info = value; }
}
public static void LoginSuccessStartAccountInfo(string playfabId) <--- THIS IS CALLED AFTER LOGIN
{
string PlayFabId = playfabId;
AccountInfo.GetAccountInfo();
Database.UpdateDatabase();
}
public static void GetAccountInfo(string playfabId)
{
GetPlayerCombinedInfoRequestParams paramInfo = new GetPlayerCombinedInfoRequestParams
{
GetTitleData = true,
GetUserInventory = true,
GetUserAccountInfo = true,
GetUserVirtualCurrency = true,
GetPlayerProfile = true,
GetPlayerStatistics = true,
GetUserData = true,
GetUserReadOnlyData = true
};
GetPlayerCombinedInfoRequest request = new GetPlayerCombinedInfoRequest()
{
PlayFabId = playfabId,
InfoRequestParameters = paramInfo
};
PlayFabClientAPI.GetPlayerCombinedInfo(request, OnGotAccountInfo, GameFunctions.PlayFabAPIFailure);
}
static void OnGotAccountInfo(GetPlayerCombinedInfoResult result)
{
Instance.Info = result.InfoResultPayload; <--- THE ERRORS OCCUR HERE
AddCards();
}
}
THESE ARE THE ERRORS I GET AFTER INITIAL LOGIN:
NullReferenceException: Object reference not set to an instance of an object AccountInfo.OnGotAccountInfo (PlayFab.ClientModels.GetPlayerCombinedInfoResult result) (at Assets/Scripts/PlayFab/AccountInfo.cs:163) PlayFab.Internal.PlayFabHttp+<>c__DisplayClass23_0`1[TResult].<_MakeApiCall>b__1 () (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabHTTP.cs:215) PlayFab.Internal.PlayFabUnityHttp.OnResponse (System.String response, PlayFab.Internal.CallRequestContainer reqContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:207) UnityEngine.Debug:LogException(Exception) PlayFab.Internal.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:211) PlayFab.Internal.<Post>d__12:MoveNext() (at Assets/PlayFabSDK/Shared/Internal/PlayFabHttp/PlayFabUnityHttp.cs:159) UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)