How do I stop a widget from resetting after it is closed?

Hey everyone. I’ve made a skill tree widget, and I’ve been using a boolean that checks if you’ve already purchased a skill and only lets you get the skill if you haven’t, and then sets the boolean to true, stopping you from purchasing the skill again. This works fine normally, but as soon as you close the widget and reopen it, it resets completely, and you can purchase the skill again. Am I missing something? What should I do to solve this problem?

Hello!

As a general rule, widgets, and UI in general, should only read data from the game. You’re not supposed to use UI to handle gameplay elements, only cosmetic stuff.
Meaning that data should be stored elsewhere, and you shouldn’t try to use widgets to remember things.

The GameMode exists as long as the level exists. so changing map destroys it. But it could be a good place to store stuff during the level.

The GameInstance exists for the entire game session, changing maps doesn’t destroy it. This is the most appropriate class for lasting stuff you might need between levels.

To save and load data between game sessions you use the SaveGame class.
You can read and write data from the SaveClass from anywhere, but it remains a good idea to handle that sort of stuff in the GameInstance, as it can be access from anywhere on your game.