Hi!
I think this should be a simple thing but i still strugel a bit. I m making a multiple levels game i made the play button but i dont know how to make it to open last lvl played not just the one from the node “open level by name”, can someone help me pls?
PS. Is a 2d singel player game for mobile.
You can store the name of the last loaded level in the GameInstance and then use that variable to load the level with OpenLevelByName
2 Likes
When you load your levels, get the level name and save it as a variable in your Game Instance Blueprint. (If all of your levels use the same Game Mode, then this is likely a good place to put this logic.)
Then, when you go back to your menu and click the “Play Button”, you can simply read that level name variable from the Game Instance and plug that into the “Open Level by Name” node.
You can also save this level name variable from your Game Instance to your Save Game Blueprint when you quit so that you can use it when the game is opened again.
2 Likes