How to save the visibility of an image

Hey I’m very confused on how to save the visibility of an image any help would be appreciated. I have watched multiple tutorials but I still can’t save the images’ visibility. I have a level selection screen and when the player overlaps with an actor the image becomes visible on the level select screen but when the player quits the image is set back to invisible. I want it so that if the player has touched the actor and quits the image will remain visible. Thanks

It would very helpful to know what exactly is the image, I assume the image is a widget. Are you by any chance loading a level? and expect the widget to be visible after the level load? We need some more information to help you.

The image is a widget yes and the actor which makes the image visible is the same actor that transfers the player to the next level, yeah I want it to be visible after level load

Basically I have a pause menu with a button which will take the player to the level select screen where they can choose what level they want to play and which level they have completed the image will basically tell them if the level has been completed or not

if im following you right you want a level select screen and you want only the available levels to be shown. or maybe a situation where available levels are shown, not completed are grayed or desaturated, and the completed are in full color.

I already have have that system but I have an image to also represent if the level is completed (a star) but my problem is that when the player quits the game the star is no longer visible even if the player completed the level. I basically have it so if the player has touched the actor at the end of the level a star appears above the levels icon on the level select page but the problem is that when the player quits the star is no longer visible

It sounds to me like the real issue is that you need a way to maintain data between level loads. When you load a level, all data about the your previous state is lost. When you do a level load your old actors get destroyed, your player pawn, player controller and that includes the HUD. What I recommend is creating a variable meant to store the state of which image is visible in something that is persistent such as the GameInstance. A GameInstance is created when a game starts and is destroyed when you.

The visibility of the image stays when I load the next level the issue is that the visibility is lost when I quit or stop the game

in that case you need a save game system. theres a bunch of tutorials on that topic ill link a few below.

Thanks but I still have a small problem the save system works but because it saves when I overlap an actor the n loads when I reach the next level when the player quits and then returns his progress is still lost any solutions?

Make sure you understand that when you save a SaveGame object it saves the whole thing so any variables in it that you dont specifically set to something will be written over with their defaults. So if you want to have the gamesave be the same with only one change you have to make sure the gamesave object you are saving has already loaded from the file first, then change the things you want to update before saving it or else it will lose its progress on everything else.

“N” loads? whats that mean? pretty much everything beyond that point makes no sense. im guessing that your saying that when you open the game the status from a previous playthrough isnt being shown. if thats the case then all you need to do is to load the save game right when the game opens.

When I load the the previous game from when the game actually starts it doesn’t work

again what does that mean? are you trying to say when the game first launches or some other time? i hate calling people out on their language but your explanation makes no sense. what your content says and the grammar / context its written, you do not convey a clear and complete thought.