Hey experts!
In this game I’m working on, the character gathers items and stores them. However the items have a value called “weight” and I’m trying to prevent the character from exceeding his max storage value.
Example: if item has weight of 5 and the storage max is 6, the item can go into storage. However when he picks up another item, he can put it in storage but can’t pick any others up unless he empties storage so there is at least 1 space left.
I have the system check that the item’s weight variable value is less than the total_storage variable (both global variables). What I need is for the system to check if there is enough room between total weight and the item’s weight.
(Example)
Total storage variable = 6
Item storage value = 5
Current storage value = 4
Game should prevent the item going into storage. Not sure how to program that and appreciate your help!