Forum rules - please read before posting.

Get access to inventory item amount

Hello, I have an inventory item set to can carry multiple. The idea is the player will be able to get multiple of this item. I need to get access to the amount of items of this kind the player has. But when I call


it always return 1.

I checked the player component and there is a section for current inventory, where it says the player has more than 1 of this item. Still the function above always return 1. Why does this happen? Is this the correct way to get the amount of a certain item in the inventory?


  • Tried to edit but it wouldn't load.
    Also, Trying out

    ** KickStarter.runtimeInventory.GetItem(_itemIndex).maxCount**

    does give the real max slot capacity that is set to 5.

    I tried the following Debug:
    Debug.Log( "Item count: " + KickStarter.runtimeInventory.GetItem(_itemIndex).count + "/" + KickStarter.runtimeInventory.GetItem(_itemIndex).maxCount);

    it always return "Item count: 1/5" no matter how many items of this type I have.

  • The GetItem function requires the item's ID to be passed as a parameter, rather than the index it appears in.

    The RuntimeInventory class is more of a "wrapper" class that handles inventory management. The Player's actual inventory data can be accessed with:


    This features a function that gets the exact count of an item, given it's ID:

    KickStarter.runtimeInventory.PlayerInvCollection.GetCount (myItemID);
  • Thank you!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.