UE5.1 Open level by name Don't work?

I’ve tried checking old threads, and even searching around old discord topics but can’t seem to find a solution. My game runs fine in PIE/Editor. I’m able to go to my main menu, and hit my “load game” option and load my saved level just fine. However when I package the game, and hit “Load game” from the main menu. It just reloads the main menu instead of the saved game/level. I’ve added all my necessary maps to the array list in the packaging settings. It just appears that “Load level by name” will not work in the packaged game.

I’ve also tried “Load level by obj ref” which seems to work. But then i’m unable to load any other level besides 1. Seeing as putting any kind of boolean check seems to prohibit the level from loading in the packaged game also.

Though it will work in the editor O.o

1 Like

Strange it works fine for me in 5.1, 5.2, and 5.3 can I see your level name and your blueprint/code for loading the level?

Thanks for the quick reply, here are the screenshots. It works fine in the editor like i said, but it don’t work when i package the game.


If i get rid of “Level name” variable i have in my save game. And replace it with lets say. In a level blueprint begin play, i set a bool in my save game “Level2” set to true, and then where my load game button is, i do a check “Level2” = true and try to load a level by object ref. It will load as it should in the editor but again when i package, it will not load the level. Even with a print string BEFORE the bool. it prints in the editor, but not packaged. not sure whats going on haha I’ve been trying to figure it out since 8 am xD

It won’t print in a built version unless it’s a debugging build but let me check how I load a level

1 Like

Oh wait try replacing the false branch with a load level by name and put the name of the level you want to load in there manually

2 Likes

Hm, so doing what you said, with the false branch. it does open the level by name.

But for some reason, it wont open the level by name when i save/load it like i have it… but it works un-packaged… so weird T_T

Where are you actually loading the ‘Level Name’ from the SaveGame? I can see you’re checking if the SaveGame exsists, but then you’re opening the Level. Where is the ‘Load Game from Slot’ node? Are you maybe fogetting to load the actual level name from the slot?

1 Like

Hey Manim8 thanks for replying. In my game mode begin play, i check again if a load save exist, and if it does it loads the game from slot and does some other things for me.

Ah ok cool. Well one thing to note is that Open Level by Name won’t work in 5.1 as there was a bug with that version. It would HAVE to be by Object ref. Not sure if it was fixed in 5.2 or not though.
I’m pretty sure it’s not possible to save the World Object reference in your save game. So maybe you could try upgrading to 5.2. But be sure to back your project up, of course.

Oh ■■■■ really? T_T If i upgrade engine versions wont that break my 5.1 project?

What’s weird with the open level by object ref is that, I can’t put any identifier without it breaking? I’ve tried to set my “Level name” variable in my level blueprint to something at begin play. I’ve also tried to add a boolean like “Level2?” and set it to true.

But again, if i try to load from my load game button. It just won’t open the level even with the open level by name obj ref. (But it does work without these checks) It works in the editor though… I’m so confused on why it isn’t working haha… thats heartbreaking to hear about the 5.1 issue xD

For example. If i do a branch to check if “Level2?” is true/false. and on true open level by obj ref Level 2. It won’t work packaged either. but it does work unpackaged. and packaged in development does print string. but it just dont open the level by obj ref if i got a branch infront of it…

Yeah I ran into the issue when I was working on a project in 5.1. I ended up going back to 5.0.3 and had to manually re-do all my code etc. But it worked.
The project I’m currently working on is in 4.27 and is level based. I save my ‘Current Level Name’ variable as a ‘Name’ type and it all works perfectly.
I would def try upgrading to 5.2 though. It shouldn’t break anything but like I said, back it up first. Although I believe when you try to open it in 5.2, it should have a pop-up window that will ask you if you want to back it up. This will make a copy of the files and save them into a new folder with the original file name with an added ‘_52’ at the end (or something like that).

Also, if you’re packaging as a ‘Shipping’ Build, you won’t get any Print Strings. They only work in ‘Development’ Builds. Just thought I’d mention.

Yeah i packaged in development too and it all prints, just wont open the level. Same thing with obj ref if i use a branch, it will print but wont open it. though it opens it without the branch… so confusing. I’m going to go hit my bong and swallow sadness… and then perhaps try to upgrade to 5.2 and hope it goes smoothe. im going to mark your response above as the solution. I appreciate you

1 Like

Upgrading to 5.2 didn’t work either =/

Strange so in 5.2 doing something like this doesn’t work?

image

I have a live demo in 5.3 and this works in it packaged man so something must be wrong with the package settings if it doesn’t work. Check the cooked map name and make sure it is identical including caps

image

Nope it just reloads the same level that I’m on, how do i check my cooked maps?

in your build settings where you choose the levels to cook into your build

I see see where i can add them to the array (edit. this is 5.1 i removed 5.2 after it didn’t work either)

1 Like

should be around here


hm yeah i don’t see that in my version. even tried to use the search bar. Just has that array of maps i can add. which I’ve done. hrm. I guess i’ll keep playing around and hope something eventually clicks lmao T_T i’m totally stumped. It did the same thing when i upgraded to 5.2 So i wanna say it’s something I’m missing myself but idk… ill try to debug some more somehow and see what i can come up with. but it prints the strings >.> sucks i got to re-package the game every time i gotta check to see if what i try works or don’t haha