After i build the game with pc/standalone or webgl i cant adjust mouse sensitivity.
Hello, a begginer here.
im working on micro fps game. i have 2 scenes first is "menu" second is "level1" i put a slider to adjust player which is mouse sensitivity in game. in unity when i test it i can adjust it when i drag it to left it gets slower and vice versa. and it stays with adjusted sensitivity when i restart game in game buttons. the problem is when i build it with Pc Standalone or WebGL i cant adjust sensitivity. slider moves but it doesnt apply the values like i did in unity. Here is my code for menu controller;
{ using System.Collections; using System.Collections.Generic; using UnityEngine; using TMPro; using UnityEngine.UI; using UnityEngine.SceneManagement;
public class MenuController : MonoBehaviour { public TextMeshProUGUI titleText; public Button startButton; public Slider mouseSensitivitySlider; //public FirstPersonAIO firstPerson; public GameObject player;
private void Start()
{
mouseSensitivitySlider.value = PlayerPrefs.GetFloat("Value", 10f);
}
private void Awake()
{
Cursor.visible = true;
Cursor.lockState = CursorLockMode.None;
}
public void StartGame()
{
SceneManager.LoadScene("Level1");
}
public void AdjustSensitivity(float value)
{
player.GetComponent<FirstPersonAIO>().mouseSensitivity = value;
PlayerPrefs.SetFloat("Value", value);
}
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613021636im_/https://answers.unity.com/themes/thub/images/avi.jpg)