Open level and run script/transit variable to new level

Greetings. I’ve recently moved to the stage of programming transitions between levels in my project.

I have a hub-location that the player constantly returns to. After the intro level, a unique dialog is played in the hub. And after certain quests are completed, when returning to the hub, the player will first see the dialog queue and only then he will get control of the character again.

Therefore, I have a question, how can I open the level “Differently”. In one situation open the level and run the script, in the second situation open the level and throw the dialog classes into the variable “DialogQueue”.

So far I’ve come up with the idea to save everything I need in “GameSave” and when changing the level load it back, load the variable into the handler and then it will decide what to do. But it doesn’t look like a complete solution to the problem.

Basically, I want to pass a variable from one level to another.

1 Like

The two main ways of passing information from level to another are

1 Game instance

2 Save game

The only problem with the game instance, is that once you quit the game, running it again will leave you right back at the beginning. With the save game, you can save your progress properly.