How can a guy pick up a key open a door with it and go to another area

So i made a forum few hours ago and a guy helped me out a lot anyways…
can someone help me so a player can acquire a key and open a door with it and the door will not open without the key.
also how to make the guy teleport to another map
Now you see since im new (and have the knowledge of a boomer) im really hard at understanding steps so i would appreciate if someone gave me a detailed guide
And have a respawn system no fancy vid of respawning just a respawing system
(i think its a bit too much for a first game)
Thx
-wirable

Welcome! :slight_smile:

The key thing can be accomplished with variables.

Use a scene variable if it’s just for one scene, global to use across different scenes.

Name it hasKey or similar. Value of 0 is “false” (no key). This is usually the default value at the start of a scene, so you don’t need to define it in the events unless the key can somehow be lost.

For whatever condition would let the player acquire this key (collision with an object, enemy drop, quest completion, etc.) you’ll need to have an action that sets the variable value to “1” (true).

From there, you can set the conditions and actions for what happens when the variable is “1”, such as being able to go through a door or portal, which can trigger a player x/y position change (“teleport”).

I also recommend checking out the wiki for basic knowledge, giving yourself time to learn more about how GD works, practice and experiment with the features. Otherwise, our advise here may more difficult to understand, even with very specific details.

Thanks. I think i sort of might understand your advice but not fully i guess i will search for info. Also there was a wiki all along?

You’re welcome.

Yes, here GDevelop 5 [GDevelop wiki]

The link is in the menu at the top of the forum, next to download.