I’m trying to create game menu where i can choose game slot from list. I got my slotNames stored in DT_SlotNames. I’m receiving names properly (printed them to test it). I’m trying to enable button to load game save if it exists and when it does I cannot cast it to BP_ThirdPersonCharacter where i got my “startingGameSave” function. How do I load game via button and my function? Blueprint of my button below (pink line is slotName string and works as it should):
Rather than calling from your character, you could call from your Game Instance or another blueprint. Check out this non-Epic affiliated tutorial for an example on setting that up:
Finally found some time to work on that. Basically I did everything as tutorial said. Save and load works. I just don’t know how to load save from main menu. I start the game with gamemode override set to BP_MainMenu. It loads the widget with 2 buttons. First button is to exit the game (works) and second opens game slot widget and then removes w_main from parent. In game slot widget there is only one button that should load level by name but all it does is removing it from parent and going back to main menu widget. Button blueprint below:
I don’t know what ‘on game loaded’ is, but I can tell you that everything was a waste, if you then call ‘open level’.
That’s because pretty much everything gets thrown away by ‘open level’. It just opens the level you name, and everything was like it was when you saved it in the editor.
If you want to get back to when you saved the game, you need to do ‘open level’ first, then load the save game, and make all the changes
Just to be clear, you have to do the loading either inside the level, or you can use something like the game instance to load stuff, because ‘open level’ doesn’t affect the game instance.
Skipping the part of saving/loading the game, i’m troubling with that open level, my main menu level won’t disappear, and level just won’t open, any ideas?
(the only button in main menu) i also tried without Remove from parent