0
Answered

Limiting items in inventory

Oliver Marshall 6 months ago in Inventory updated by Devan 2 months ago 2

Is it possible to limit the number of items supported in the inventory?

 

I can see a weight limit option, but I'm after a number-of-items option. Perhaps where the bag only holds, say, 10 things. 

I could give each one a weight of 1 and limit it to a weight limit of 10, but that also prevents me from using weight in the future.

Olly

Unity version:
Game Creator version:

Answer

Answer
Answered

Hi Oliver;

You're correct; there's currently no way to do that without using the Weight. However, you can also limit the amount of items stacked (not sure if this will help).

Games usually have a per-weight limit or per-amount-of-items constraint, but not both (usually, since makes it would make it more difficult to manage).

Answer
Answered

Hi Oliver;

You're correct; there's currently no way to do that without using the Weight. However, you can also limit the amount of items stacked (not sure if this will help).

Games usually have a per-weight limit or per-amount-of-items constraint, but not both (usually, since makes it would make it more difficult to manage).

If possible, I'd greatly appreciate your help as a bit of a workaround to this weight limit. Would I be able to effectively limit the inventory slots by assigning each item 1 weight but if additional units are added of the same item, the additional duplicate items have 0 weight? this way I can limit the inventory slots but allow for stacks of items (ie food), so long as its within that item's stack limit.

I'm still learning both unity as well as game creator, so any help or suggestions would be a huge benefit.