Problem with events

Hello I installed the version 5.0.139 for Windows of GDevelop 5, and I started trying to make a game. I have a problem and I would like to understand where I am wrong. In my first level there is a character who has to collect gems to score points and to level up he has to take a key. I set the first condition which says:
When HERO (character) collides with GEMMA
the action he takes is:
DELETE - GEMMA
I tried this first event and everything works. I just enter a second event, which is the following:
When HERO (character) collides with KEY
the action it performs is:
DELETE - KEY
At this point when I try the game the objects are no longer eliminated, as if the two events did not exist.
Where am I wrong ???
Thanks for your help.

Hi, how did you enter your events? Did you put both collision-conditions in one event block? Each block defines the conditions for the actions in the second column (e.g. delete the object). If you put both collision events in one block it means your player has to collide with both objects at the same time to delete the gems and the key. The solution is to put each collision condition and the action in one block.
But of course I am just guessing. If my guess is wrong you should definitely post your events.

Meanwhile, I wanted to thank you for your answer. I am attaching a screen of the events. You tell me about an event group, how do I create an event group? Thanks for the help you will give me

I think I solved it thanks to your help now it works. Thank you for the suggestions.

1 Like

Yeah, your first screenshot shows two conditions in the one event, which can be read as:
“If the player collides with a gem and a key at the same time, delete the gem and the key.”

Whereas your second screenshot correctly puts each condition into its own event. This can be read as:
“If the player collides with a gem, delete the gem. Seperately, if the player collides with a key, delete the key.”