# Save Slider Values

**URL:** <https://forums.unrealengine.com/t/save-slider-values/459532>\
**Category:** UI\
**Tags:** slider, unreal-engine, UE4, Blueprint, question\
**Created:** [December 15, 2019, 2:19am UTC](https://forums.unrealengine.com/t/save-slider-values/459532 "2019-12-15T02:19:54Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![TTVSaleekius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTVSaleekius](https://forums.unrealengine.com/u/TTVSaleekius)\
**Post date:** [December 15, 2019, 2:19am UTC](https://forums.unrealengine.com/t/save-slider-values/459532/1 "2019-12-15T02:19:54Z")

</div>

So I recently made a master volume slider, and it’s working all nice and dandy. The only problem is when I exit the settings screen and go back to it, the slider is back at 100%. Now the music stays at the volume which I set it to, which is good. I just want to know how to keep the slider position to stay where I left it.

Here’s what I have

 ![293967-wbp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/8/a/b8a4c3258f5312a5977b2b3a61bcad61f8687d60.png)

![293968-lbp.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/1/4/21455888d3fa6c287b3d78b54ae6044c457b5a27.png)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f18042ba](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f18042ba](https://forums.unrealengine.com/u/anonymous_user_f18042ba)\
**Post date:** [December 15, 2019, 2:37am UTC](https://forums.unrealengine.com/t/save-slider-values/459532/2 "2019-12-15T02:37:39Z")

</div>

Hi,  
You can store the value somewhere.  
Then when you are showing the widget containing the slider, you can use the Set Value from Event Contstruct.  
Getting the value from where you stored it.

 ![293969-soundslider.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/0/5/f05f3c577caf843bf0c56accd9ce91c721e1c1ce.png)

---

<div class="post-metadata">

**Author:** ![TTVSaleekius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTVSaleekius](https://forums.unrealengine.com/u/TTVSaleekius)\
**Post date:** [December 15, 2019, 3:02am UTC](https://forums.unrealengine.com/t/save-slider-values/459532/3 "2019-12-15T03:02:07Z")

</div>

I’m pretty new to all this, how do I call the slider value?

---

<div class="post-metadata">

**Author:** ![TTVSaleekius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTVSaleekius](https://forums.unrealengine.com/u/TTVSaleekius)\
**Post date:** [December 15, 2019, 3:04am UTC](https://forums.unrealengine.com/t/save-slider-values/459532/4 "2019-12-15T03:04:37Z")

</div>

And how would I set the value?

---

<div class="post-metadata">

**Author:** ![SupDeity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupDeity](https://forums.unrealengine.com/u/SupDeity)\
**Post date:** [December 15, 2019, 9:45am UTC](https://forums.unrealengine.com/t/save-slider-values/459532/5 "2019-12-15T09:45:55Z")

</div>

Do you want to save it so that it persists even after you reopen your game or in the current session only?. Also to get the slider value, go to your widget bp designer and select the slider you want to get the value of, in the details section on the top you will see a checkbox for Is variable or something similar. click on that. now in the widget bp area. in the variables section you will see that the a variable with the slider’s name will appear. you can use that variable to get the value of the slider.

---

<div class="post-metadata">

**Author:** ![SupDeity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupDeity](https://forums.unrealengine.com/u/SupDeity)\
**Post date:** [December 15, 2019, 9:48am UTC](https://forums.unrealengine.com/t/save-slider-values/459532/6 "2019-12-15T09:48:09Z")

</div>

When you have set the value to another variable which lies in something like the player character you can use the set value node and use the slider variable as target. Basically what METAL GEAR GAMES has shown. this needs to be done in the widget bp which has the slider.

---

<div class="post-metadata">

**Author:** ![TTVSaleekius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTVSaleekius](https://forums.unrealengine.com/u/TTVSaleekius)\
**Post date:** [December 15, 2019, 2:25pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/7 "2019-12-15T14:25:47Z")

</div>

One that saves when you reopen the game. Also, could you show screenshots of what you’re talking about. I’m all a little confused here sorry lol

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_f18042ba](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_f18042ba](https://forums.unrealengine.com/u/anonymous_user_f18042ba)\
**Post date:** [December 15, 2019, 6:33pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/8 "2019-12-15T18:33:54Z")

</div>

If you want to save slider so that it holds its value when you reopen your game, you should use a SaveGame Object. For more info on this topic: [Saving and Loading Your Game in Unreal Engine | Unreal Engine 5.1 Documentation](https://docs.unrealengine.com/en-US/Gameplay/SaveGame/index.html), or you could search for it on YT.

In this SaveGame Object you can add a variable (float) where you can store the slider value.

![294021-savegameexample.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/8/4/a/84a13323c2976984dd38c02d773a2ef38199ec14.png)

When you open the widget containing the slider, you want to load this variable and set the slider’s current value to it using the “Set Value” node. You must make sure that the slider has “Is Variable” checked, as SupDeity pointed out.

![294023-sliderdetails.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/3/5/c35a498918700d33c9e37d52ee88b7cec4c0479c.png)

When you change the slider’s value, save the new value to the SaveGame Object.

 ![294010-widgetexample.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/3/b/73b37b1914eec4328369d08e97b100d383018a01.png)

---

<div class="post-metadata">

**Author:** ![TTVSaleekius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTVSaleekius](https://forums.unrealengine.com/u/TTVSaleekius)\
**Post date:** [December 15, 2019, 9:37pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/9 "2019-12-15T21:37:03Z")

</div>

Where do you get the “Save Game Object” from? sorry I’m a little slow to this stuff

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 15, 2019, 9:59pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/10 "2019-12-15T21:59:02Z")

</div>

It’s a variable you create yourself, you can see it on the left hand side in the variable list. Create a new variable, select it and set its type to `Your_Save Game` - `Object Reference` in the _Details_ panel.

edit: I’ll just add that you need to create a save game object first.

---

<div class="post-metadata">

**Author:** ![TTVSaleekius](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TTVSaleekius](https://forums.unrealengine.com/u/TTVSaleekius)\
**Post date:** [December 15, 2019, 10:10pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/11 "2019-12-15T22:10:54Z")

</div>

How do you get the “Target” to appear underneath The Set Slider Variable node

---

<div class="post-metadata">

**Author:** ![Everynone](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/everynone/32/1135017_2.png) [@Everynone](https://forums.unrealengine.com/u/Everynone)\
**Post date:** [December 15, 2019, 10:16pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/12 "2019-12-15T22:16:36Z")

</div>

You can’t _make it_ appear. It simply means the variable is a part of another actor and the node needs a target to, well, target a specific actor.

I may want to read up on [Variables](https://docs.unrealengine.com/en-US/Engine/Blueprints/UserGuide/Variables/index.html) and [Save Games](https://docs.unrealengine.com/en-US/Gameplay/SaveGame/index.html).

---

<div class="post-metadata">

**Author:** ![Faze\_Kaas](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Faze\_Kaas](https://forums.unrealengine.com/u/Faze_Kaas)\
**Post date:** [November 27, 2022, 3:20pm UTC](https://forums.unrealengine.com/t/save-slider-values/459532/13 "2022-11-27T15:20:36Z")

</div>

The cast fails for me at event construct, how do I fix this?
