widget button setvisibility resets after restarting game

hello everyone, I set the visibility of the button in my widget to hidden, it works fine when I start the game. but if I close and open the game, it becomes visible again and I have to click the button again so that it is hidden, what should I do to keep it hidden all the time after clicking the button once?

1 Like

I’m not sure exactly what you’re trying do, but there are few things to say. The widget won’t save anything you’ve done before. For that, you could set a bool to check if you already pressed the button and store that bool inside somewhere else, such as your character blueprint for example. However, it also won’t solve the problem entirely, since if you restart the project, everything will reset.

You must create a save file to store these informations. Is actually simple and there is plenty of tutorials teaching that. In case you want to save these informations, then you must create a save file for that.

Now, if you only want to get these information during the game match, you could use a bool or create your widget inside another blueprint and store there. Promote to a variable and then, instead of creating a new one, you call the one you set as a variable. That can fix some issues.

I’m not sure if I got the assignment, but if you need more help you can reply.

I created 2 buttons in a row, one of the buttons should disappear forever after clicking once, I provided this with bool. I can only click once when I close the game and reopen the game, but the visibility of the top button is reset. I want to keep the visibility hidden forever even if the game is opened and closed.

Then you need to store that information inside a save file and run on your game instance a load game. So everytime your game is open, it will load all the previous bools you saved. I used this on my game to display or hide the ‘continue’ button if the player has any progress saved, if not, the ‘continue’ button is collapsed.

Ryan Laley has a lot good tutorials in his channel. I’ve learned from him.