- Home /
set slaider to playerpefs value
https://cdn.discordapp.com/attachments/310487287957815297/407551823902146562/unknown.png thats my slider PlayerPrefs.SetFloat("volume", volume); thats how i set my player perf
the problem is when i stop game and run it again the sound is what i last time i set but visually 100% befor i cangle it
Answer by melsy · Feb 02, 2018 at 04:04 PM
Kind of unclear but I'm guessing you want the slider to return where it was before on scene load. OnEnable () will activate when a game object becomes enabled. Put a slider.value = playerprefs.getfloat(valueName) inside this method. Now when the game loads this value will be set
Okay sry my bad englich but when i cangle slider value it saves it to player prefs and when i close the game i wanna the slaider go back to the same value
Your answer
![](https://koobas.hobune.stream/wayback/20220612151534im_/https://answers.unity.com/themes/thub/images/avi.jpg)