question

Michael Brilz avatar image
Michael Brilz asked

Save buttons to buy players in the inventory in PlayFab,how do i use the loaded items from the inventory

and I don't find a good tutorial for my problem. I have several buttons with which players can buy different skins. I would like to save them in the inventory and load them back into the game. Whats the best way to do this?

Player DataPlayer Inventorygame manager
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

After players purchase the items from Catalogs or Stores, PlayFab would add the corresponding item instances to the player’s Inventory. So you do not need to “save” them in the Inventory manually. Client API GetUserInventory can be used to retrieve the user’s current inventory of virtual goods and Client API ConsumeItem can be used to consume uses of a consumable item. You can click the links to check their API references.

5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Michael Brilz avatar image Michael Brilz commented ·

Thank you for your prompt reply. Since I'm still a beginner in PlayFab and Unity, could you have given me a code example for both Api's?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Michael Brilz commented ·

It will take some time to code and test the sample. I will reply to you if we make some progress.

0 Likes 0 ·
Michael Brilz avatar image Michael Brilz Sarah Zhang commented ·

Thank you very much :)

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]