Announcement

Collapse
No announcement yet.

UMG Keeping slider position after resetting game.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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?

    #2
    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.

    Comment


      #3
      Originally posted by Dealman View Post
      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.
      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.

      Click image for larger version

Name:	FOV.PNG
Views:	1
Size:	331.5 KB
ID:	1083858Click image for larger version

Name:	FOVCal.JPG
Views:	1
Size:	28.0 KB
ID:	1083859

      Comment


        #4
        Great job! Myself and others will surely find this useful

        Comment


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

          Comment

          Working...
          X