Hello I'm using Javascript and PlayFab SDK
when I get:
PmPlayerProfile = new PlayFabClientSDK.GetPlayerProfile({ShowDisplayName : true,});
I can see the data i want in console.log
but when I try:
PmPlayerName = PmPlayerProfile.DisplayName;
or
PmPlayerName = PmPlayerProfile.data.DisplayName;
I got the following error:
Cannot read property 'DisplayName' of undefined
please Help
Please navigate to [GameManager]->[Title settings]->[Clients Profile Options]. Firstly, make sure [DisplayName] is checked.
Then you can try PmPlayerName = PmPlayerProfile.PlayerProfile.DisplayName.
BTW, @Joerg Miethe, the way you use profile constraints is not correct. Here is an example:
PmPlayerProfile = new PlayFabClientSDK.GetPlayerProfile( { "ProfileConstraints": { "ShowDisplayName" : true } } );
3 People are following this question.