How to continue to the next level in the game without making a new win blueprint every level?

Two ways basically. One is level streaming, the other is passing information through the game instance.

  1. Level streaming:

With level streaming, you have one main persistent level in which you keep everything that doesn’t change. That’s where you’d keep the menu system and list of levels. When the player makes it through a level, the persistent level BP would do the menu stuff and then load the next level in the list.

  1. Game instance

Even if you’re using ‘open level’ to change levels ( which completely trashes everything in it’s path ), the game instance does survive. So, when the player reaches the end of level X, the level X BP just loads the main menu. The main menu is a map on it’s own - point to note.

The main menu knows which level has been played when, because it’s keeping tally in the game instance. It then marks the last level as done and does ‘open level’ on the next level.

The game instance is just a ‘basket of variables’. If you want to know which levels have been played, you can make up your variables like this ( just an idea ):

See, it’s just a list of the names, and a list of bools so we know what’s been played.

So, here I’m just getting the next false entry from the level status array, I get the name for that level and open it. I also marked it as used.

PS: I haven’t ‘pressure tested’ this, but it’s the general idea…

1 Like

Hi, so I made this win screen, it works, the main menu button opens the main menu and the continue button opens the second level, but let’s say I have multiple levels, do I have to make a new widget blueprint for every level I make or is there another way? is there a way to make level lists using blueprints ? The way it is now i will have to make a new blueprint widget and blueprint actor that triggers the wining screen for every level, which i dont have a problem making, but it does not feel optimal for performance. Thank you.

Excellent :slight_smile:

It took some time, but I finally got it to work using the game instance, Thank you!

Your elegant answer to a not-so-simple problem has amazed me and saved me a lot of headaches. Thank you.

1 Like