Forum rules - please read before posting.

Inventory Counter with Variable

Hi,

short question: The player can collect coins and invest them ingame. There is a coin icon in the inventory.

created an Inventory-Item called "Coins" and "carry multiple" in the stack and available on start. Now i try to find away that the counter in the inventory displays my coin variable (int) .

i put in the token [var:0] in the "label" / text in the ui prefab but still, when i spend money, the amount deducted is not displayed. Is there another way to display the number of coins in the inventory ?

Comments

  • The [var:X] token will display the value of a Global Variable - it's not related to the Inventory.

    What UI prefab and Text box are you referring to? The one that represents the Inventory?

    If you're using Unity UI for your Inventory menu, then you'll need to place a Text component as a child object for each of your item Buttons in the UI prefab's Hierarchy. The item's "count" text should then be automatically displayed there.

    This should also show up automatically if you use AC for the menu's Source. If you temporarily switch back to this, does it show?

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.