Checking this one on how to save game
For your problem, let assume you will have an auto save for game, so every time player finish level, you can save highest level, let’s call HighestFinishedLevel variable, in your save game, since this save can access anywhere, even in widget, you can get load this HighestFinishedLevel value when you open your game, or open level selection, if it from < 4 you can enable 1-4, if it >= 4 you can enable 6-20, ect…
I’m attempting to make a level select screen and I am unsure how to implement some features. Currently, I am using a Widget Blueprint and have 20 buttons on the screen, with each button, upon being clicked, opening its corresponding level.
I would like to be able to disable buttons if I have not yet reached that level. So, if I only completed levels 1-4, then the buttons for levels 6-20 will be disabled. I attempted to do this with a boolean variable within an actor’s blueprint (so if I interact with this actor, the boolean will be set true) and then access that variable from the Widget Blueprint, but I cannot figure out how to access the variable. I also tried to do this the other way around and access the Widget Blueprint from the actor’s blueprint, but had the same issue.
I also want to be able to remember which buttons are disabled/enabled if I close the game and open it up again. I think this is mainly related to saving variable information, so would I have to have a variable for each button, indicating whether or not it is disabled/enabled?
Also, since this is a Widget Blueprint and not a Level, how would I make this the default screen when opening up the game? Thank you for any help.
Thank you for the response!
I think I almost fixed the problem thanks to your help, but I still have a small issue. Using the answer from that question, I need to create a “MySaveGame” variable, but then under “Default Value” the only option I can select is none and that ends up giving me an error.
I tried a different method that I saw in the documentation, which involved using “Create Save Game Object” then casting that to “MySaveGame.” This seems like it would work, but I cannot figure out how to get around creating two “Save Game Objects” since I need to create one in the Widget Blueprint and another in my Actor Blueprint. So changing the “HighFinishedLevel” in the Actor Blueprint does not affect the value of the “HighestFinishedLevel” in the Widget Blueprint.