2D Game Going Between Levels

Lets say i have 2 levels which looks like this


when player interacts with door 1 the game will open level 2 and teleport the player to door 3s location, same thing happens with door 2 and 4. For now i have a system when i interact with door 1 it opens level 2 but it starts player on player start location. How can i change the location of the character when i open the level?

First, create a game instance if you don’t have one already to save variables between levels. Here’s a tutorial you can check out to see how you should create that:

Inside the game instance, create a vector type variable.

Once that’s done, you can go ahead and close the game instance, and save the player character’s location inside that variable upon interaction, like this:

Then open up your new level’s level blueprint like this:

(The currently open map’s level blueprint will be opened)

And set the player character’s location accordingly after Begin Play like this:

Hope this helps! :innocent:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.