Hi! Sorry for frequent questions, but I’m trying to make an inventory where each SlotIcon has an object variable called occupied, which should turn from false to true when I place an item in that slot.
I already have this working but the thing is it doesnt work with items that have been
added to the game at the beginning of playtesting/ the scene.
But the event that checks SlotIcon.occupied = 0 doesn’t work. The item doesn’t get stored and the condition never triggers.
Here’s what’s happening:
- Each SlotIcon object has a variable occupied (default = 0).
- When picking up an item, I loop through each SlotIcon.
- I check:
If SlotIcon.occupied = 0 → fill the slot → set occupied = 1.
But that just does not work.
Can someone help me with this please and tell me the solution?
Thanks in advance! yippee
