Get Current Level Name returning none

I want to have a continue option at my main menu that is not usable until you first play the game. I alse want to have the game save your current level and save it along with setting a bool to true so that next time you play the continue option is usable and puts you in the level you were previously on. I think I have mostly done this, but the problem lies with the level name. When you click the play button, it opens a level called “city”, but when I press the save button to run my level saving function, it prints “None” (it should print the level name variable it is saving).

Please tell me what I have done wrong.

I don’t think you’re getting the correct level name, you might be forgetting the prefix.

Try this:

I have tried that and have managed to save the current level name in a file. Unfortunately, when I load the level name from the file for the continue button, I get this error:

i know its a old post but i’m running into the same issue did you ever find a fix?