Search Unity

Are non-stackable inventory stackable?

Discussion in 'Game Foundation' started by seventythreeers, Feb 23, 2021.

  1. seventythreeers

    seventythreeers

    Joined:
    Nov 15, 2016
    Posts:
    18
    Looking at the video introduction with the Flipper Dunk demo, I assume those "balls" are unique items and the players can not own more than one per model (i.e, can not own 2 penguin balls), is this called "non-stackable"?

    Right now, no matter if set an item to stackable or not, I can purchase more than once.

    Does anyone have the same trouble I am having?

    Thanks a lot. Really looking forward to the final release of Game Foundation, it is really cool.
     
  2. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    8,059
    "Stackable" means that if you have more than one of the same items (like you have two basketballs in this case) then you can store them in the same spot in your inventory. It has nothing to do with the ability to purchase more than one.
    inventory.jpg
    In this picture, the items in the bottom-right corner are stackable (there are five in the same inventory spot), but the things above it aren't (they take up separate places in the inventory).

    Since I don't use any kind of in-app purchases ever I have no idea if GF supports unique items out of the box or not, but in theory you can implement it yourself, just create a unique category, put in the items you want so the user only can have one of each and when you prepare the transactions, check if the player have the item already or not if the item has this category tag.
     
  3. seventythreeers

    seventythreeers

    Joined:
    Nov 15, 2016
    Posts:
    18
    Thank you so much, that's exactly the answer I was looking for.
     
  4. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    400
    Thanks for that awesome answer @Lurking-Ninja!

    @seventythreeers To build on Lurking-Ninja's answer, if you do want to do IAP purchases that can only be bought once you can use Unity IAP and set the purchases up as Non-Consumable, those types of products can't be purchased twice (though it doesn't prevent a user from owning more than one of whatever inventory item that transaction distributes as a payout, right now you'll have to take precautions against that yourself). We've recently had some talks about ways we want to improve the non-consumable transactions/unique inventory items situation, but I don't have any info on when those kinds of features might be worked on at this point.

    Glad you're enjoying Game Foundation we're happy to have you!
     
unityunity