- Home /
sensitivity slider/ drop down help
Hello! I need help. In my options scene, I want there to be a drop down, that goes from 1-10, (2 of them, one for x, one for y). I'm using the FPS Controller script using the MouseLook script. I have no idea how do do any of this :(. I just want to access:
public float XSensitivity = 2;
public float YSensitivity = 2;
(on the mouse look script) with the drop down making the defult 2, and making it so you can change them each from 1 through 10. (also making it save the players choice with player prefs and load it again). Thank you.
You seem to know PlayerPrefs and exactly what you want. What do you have trouble with?
player prefs kinda confuses me on how to set the values save them, im a noob. And how I would technically do this, take the Sensitivity from mouselook etc
I know I look like a total noob, but this is what I have ( I need to do it twice for the x and y but their on separate sliders): using System.Collections; using System.Collections.Generic; using UnityEngine;
public class sensitivitySliderScript : $$anonymous$$onoBehaviour {
public float xFloat;
void Update () {
$$anonymous$$ouseLook.XSensitivity = xFloat;
PlayerPrefs.SetFloat("currentX", xFloat);
xFloat = PlayerPrefs.GetFloat("currentX", 0);
}
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
How to make FPS Camera bounce when walking 1 Answer
Distribute terrain in zones 3 Answers
localRotation rotates by 180° 1 Answer