Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Inventory Item can't get custom json data

Discussion in 'Economy' started by Choccy_vr, Sep 11, 2023.

  1. Choccy_vr


    Oct 31, 2021
    Hello I am using Unity Gaming Services Economy and more specifically the inventory system. I am trying to get custom data from the inventory items but it doesn't work it just returns null.(code:
    Code (CSharp):
    1. var inventoryResult = EconomyService.Instance.Configuration.GetInventoryItems();
    2.        foreach (var item in inventoryResult)
    3.         {
    4.             var data = JsonConvert.DeserializeObject(item.CustomDataDeserializable.GetAsString());
    5.             Debug.Log(data);
    7.         }
    I have checked if it was getting the object and it was. I didn't seem to find how to get custom data on the docs and had to rely on just description in the ide and some forums with limited info. Personally I find it baffling that unity doesn't document a important part of their service. Any help would be greatly appreciated.
    Last edited: Sep 17, 2023