46 UI menu changes slider value away from runtime?

Hi,

I have a Unity 4.6 UI menu using sliders, it seemed ok but now when I try to now set values on scene start to “remember” what the slider value was set to before leaving the scene it always goes back to the initial value of 1.

On start of the scene I load the slider value like this:
mySlider.value = PlayerPrefs.GetInt (“slider1” );

When I change the value of the slider I save like this:
PlayerPrefs.SetInt (“slider1”, mySlider.value );

But this does not seem to remember the value…
The I noticed that if I change the onValue changed event from runtime to editor and runtime it does a reset of the sliders value not even in play mode?!

Youtube vid

How do I make the slider remember it’s value on scene swapping/changing?

Any help would be appreciated :slight_smile:

Hi,
i think you have to call the Save() method because Application.Quit is ignored in the editor or the web player so the playerprefs dont get auto saved.