- Home /
Mouse sensitivity
Is there away to change general mouse sensitivity, this means all mouse movements not just first person view. If anybody knows how to please tell me.
You can't. The Project Settings aren't accessible from script, from what I've seen.
Ins$$anonymous$$d, you could hide the cursor and make your own cursor so you can have your own sensitivity on it.
Answer by static_cast · Nov 15, 2014 at 04:59 PM
1) There's nothing wrong with using the editor to do things. I learned that the hard way.
2) Here is code to do FPSMouse:
float mouseSpeedX = 1;
float mouseSpeedY = 1;
float xRotation = 0;
float yRotation = 0;
void Update()
{
//Get mouse input
yRotation = -Mathf.Clamp(Input.GetAxis("Mouse Y") * mouseSpeedY, -80f, 80f);
xRotation = Input.GetAxis("Mouse X") * mouseSpeedX;
//Apply to camera and player
Camera.main.transform.eulerAngles += new Vector3(yRotation, 0f, 0f);
transform.eulerAngles += new Vector3(0f, xRotation, 0f);
}
This script assumes that you're using a player to rotate on the side-to-side and a camera to rotate up-to-down.
Ok, but say I have two mice, one is not very senstive while the over is super so. how do I change the sensitivity in the stand alone build so they can be the same sensitivity.
Answer by AngryBurritoCoder · Nov 15, 2014 at 04:39 PM
yes there is , if you code it correctly in the first place. Go Unity Bar On Top -> Edit -> Porject Settings -> Input Then ... Find the mouse X, Mouse Y inputs, and change the sensitivity setting to higher or lower ( pss you gotta use those inputs in your code for it to affect all your mouse sensitivity )
I knew you could do this but is there a way to change the senstivity through a script, this does it through the editor.
Your answer
Follow this Question
Related Questions
Look rotation is "Snappy" 1 Answer
Mouse look Y axis sensitivity doesn't change 0 Answers
How to make a mouse sensitivity slider? 1 Answer
Mouse Sensivty Problem 2 Answers