Slider value not stored!

Hi All!

I have created this slider where the user can change while playing. The slider’s value is bound to the textblock below it. If the player change the slider’s value everything works fine. However, once the player press the back button on the HUD then return to the same HUD where he/she changed the slider, the slider’s value rests to the default value instead of showing the value that the player just changed!

How can I store the slider’s value so that it remain as it it after removing the widget and returning back to it again? I couldn’t find any node that helps after the “On Value Changed”.

Please note that that slider doesn’t change any setting or affect anything in the game. It’s just changing its value.

1 Like

Values are not stored if you destroy the widget :slight_smile:

A quick way around this is, instead of destroying the widget, just hide it.

The long way, is you have to store the result somewhere. Where depends on how long you need it for.

Just for the run, you can use the player, or game instance.

If you want it to remember the value next time you run the game, then you need to use a save game.

How to do that? I couldn’t find a “hide” function under the widget functions! :thinking:

I mean I’m currently using “remove from parent” and as you said I should use a hide function, right?

1 Like

1 Like

Thanks, I really appreciate it .

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.