Two ways basically. One is level streaming, the other is passing information through the game instance.
- 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.
- 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…