I can grant a character to player in cloud script , but at the same time I want to update the statistic. how can I got the characterId I created just now? I use grantAssistantPet.CharacterId, but it fail.
var grantAssistantPet = server.GrantCharacterToUser ({ PlayFabId : currentPlayerId, CharacterName : "Monkey", CharacterType : "Fire" }); var updatePetStatistics = server.UpdateCharacterStatistics ({ PlayFabId : currentPlayerId, CharacterId : grantAssistantPet.CharacterId, CharacterStatistics : [ { "StatisticName": "Level", "Value": 1 }, { "StatisticName": "Experience", "Value": 0 } ] });