Level unlocking

Okay so, I want to have multiple levels, but to unlock the next one you have to beat the current one. So, if you just downloaded the game, you can’t play level 2 until you beat level 1. How would I do that?

You must have a condition that lets the game know that the player has reached the end of the level first. (For ex: Assuming you have a door going into the next level: If [any object] is in collision with [teleporter door] change the scene to the next level and set a variable to a value. Then, have an event that says, If variable_______=_______, then have an event under that that’s called Trigger once while true . Then, have a subevent, Condition: [whatever you want the gamer to do to go to the next level] under that: Trigger once while true event. Action: Change the scene to whatever scene the next level is on.

Tell me if that works! Good luck!:slightly_smiling_face:

For a more direct example, there is a “Level Selection Unlock” example that is built into the engine. It is also available here: https://gdevelop-app.com/game-examples-starters/

Well, I have a level selection screen, and I want them to only be able to select level one, until they beat level one (which will unlock level 2 on the level unlock screen). Probably should have specified this better.

Check out this example: https://editor.gdevelop-app.com/?project=example://level-selection-unlock The best part is, it’s exactly what you’re looking for!

Thank you! I’m gonna try this out right now.

1 Like

In the example, at the level unlock scene, it looks like at first there are no events, Click the tiny arrow on the left to the event group (the big text highlighted in blue) and they should show.

I know, thanks anyway!

1 Like