Sunday, August 14, 2022
HomeGame Developmentunity - Set DisplayName in textfield issues Object reference not set to...

unity – Set DisplayName in textfield issues Object reference not set to an occasion of an object


Of us. I am making an attempt to set the displayname default worth instantly from the API, the debug log appropriately informs the username. However after I consider that it ought to fill the textfield it generates an error, might somebody information me to implement this perform it might be essential for me I have been making an attempt since yesterday, however with out success. Any assistance is welcome, thanks prematurely.

Console error picture —>
enter image description here

enter image description here
#area DisplayName

   public  void PlayerData(string playFabId)
    {
        PlayFabClientAPI.GetPlayerProfile(new GetPlayerProfileRequest()
        {
            PlayFabId = playFabId,
            ProfileConstraints = new PlayerProfileViewConstraints()
            {
                ShowDisplayName = true
            }
 
 
        },
  (consequence) =>
  {
 
 
      Debug.Log("The participant's DisplayName profile knowledge is: " + consequence.PlayerProfile.DisplayName);
      playerNameText.textual content = consequence.PlayerProfile.DisplayName;
 
 
  },
(error) =>
{
    Debug.LogError(error.GenerateErrorReport());
});
    }
 
 
    #endregion DisplayName

Full error

NullReferenceException: Object reference not set to an occasion of an object
PlayFabController.<PlayerData>b__29_0 (PlayFab.ClientModels.GetPlayerProfileResult consequence) (at Property/Scripts/PlayFabController.cs:232)
PlayFab.Inner.PlayFabHttp+<>c__DisplayClass23_0`1[TResult].<_MakeApiCall>b__1 () (at Property/PlayFabSDK/Shared/Inner/PlayFabHttp/PlayFabHTTP.cs:215)
PlayFab.Inner.PlayFabUnityHttp.OnResponse (System.String response, PlayFab.Inner.CallRequestContainer reqContainer) (at Property/PlayFabSDK/Shared/Inner/PlayFabHttp/PlayFabUnityHttp.cs:207)
UnityEngine.Debug:LogException(Exception)
PlayFab.Inner.PlayFabUnityHttp:OnResponse(String, CallRequestContainer) (at Property/PlayFabSDK/Shared/Inner/PlayFabHttp/PlayFabUnityHttp.cs:211)
PlayFab.Inner.<Submit>d__12:MoveNext() (at Property/PlayFabSDK/Shared/Inner/PlayFabHttp/PlayFabUnityHttp.cs:159)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments