UMG Keeping slider position after resetting game.

I am trying to get my sliders to keep their position after the game is reset but they always start off to the left at 0. Any Suggestions?

I believe what you’re looking for is to use the Game Instances. I have yet to use these myself, but I’m sure you’ll find some interesting information if you do some research. :slight_smile:

I am using the GameInstance blueprints thanks, I use this to save all my settings. The problem is that it only keeps the data until the game is reset, then you have to load the data again. The problem was finding the code to do it.

I did just figure it out though…

For anyone wanting to use this… This is in my GameInstance Blueprint so the button is cast from the setting menu widget. The slider float (0-1) “FOVRaw” is saved to a slot “FOV_Raw” and loaded back in when the game is turned on and every time the settings menu is opened, just as I did for all other settings, and is used to set the slider position at load “FOVSliderLocation”, then calculated to set the text “FOVAngleText” and to set the Field of view on the FirstPersonCharacter Blueprint. Once the slider is moved again it sets the “FOVSliderLocation”, that was set by loading the game, to the slider float “FOVRaw”, otherwise the slider will not move when you try to.

As for the calculation, set a min and max FOV angle (I used 90 and 120), make them editable. This sets the scaling.

Great job! Myself and others will surely find this useful :smiley:

I will share all I can, just ask if you want more info!