Forum rules - please read before posting.

Show the number of a specific item player has in inventory

Hi

I want to show in an UI just the number of a specific item in inventory (in this case, the inventory item is  money). In this post  there is a meter which shows (i'm assuming bymthe way since i couldnt try) that. How can we use such code ( maybe through "Writing a custom Action" ?)

Thanks.

Comments

  • UI as in Unity UI?  If a slot's linked Button has a Text component attached (can be a child), then it'll display the number being carried, provided Can carry multiple? is enabled for the item in question.
  • Hey Chris.

    I will give a try by trying it but i'm not clear what you mean by text component attached part. Can we attach text components to the iventory items? Im trying this with AC ui by the way, assuming the post i link does so too.
  • edited January 2015
    That's when using the new Unity UI. Don't know how any of that works using Unity GUI.

    Made an example. If you look at the first image you'll see I've added a text component as a child to one of the inventory buttons. I have 16 of these items, and in the second image you can see the text component getting replaced with the number of items.

    imageimage
  • edited January 2015
    Alright, that clears the air. I'll do the changes in a duplicate of inventory and try this asap.

    Thanks alot Chris and Eastman!
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.