[Solved] How to add object to inventory slot after opening chest

I’m having a lot of trouble adding in my gem from the chest to the inventory slot after I open it. The gem is on the base layer in the chest when you start the game.

Please help. I really need this and most likely this is my last issue related to inventory.

well…looks a bit overcomplicated…imo…

what i noticed is that when variable found is false and the var full is false turn the var full to true.( first events)

in your last events the var full = false is part of the condition…
i would first debug/check if this var is false when needed.

and debug the var collected too…

create 1-2 debug texts and check if these var are working as intended.

Edit: i also wouldn’t use a keypress without trigger once…in general

1 Like

@RMDB I have done everything like you said so far, however the only problem is that the debugger is showing me that none of the variables are working.

Here is the updated event sheet if needed

Why are you finding a full inventory slot to place the gem? If they’re all empty at the start, the first gem will never be collected.

I have put the condition as false now but it still doesn’t get collected.

For the key it works but for the gem it doesn’t work for some reason. Even with the same exact events they both have. I’m a bit confused on why.

Move the last event to the left by 2 indents, so it’s in line with the first event (the one with the ‘s’ key pressed condition).


As it stands, in order for the gem to be collected, the conditions of the first and third events must be met. Because the first event has a trigger once condition on it, that means the player must collide with the gem when it’s first created (which is when the chest is opened).

1 Like

Perfect! Thank you both so much it works now.
This was the solution that worked for anyone curious

2 Likes