- Home /
How to fix mouse Look X and Y sensitivity (built-in script)
So I'm trying to make an FPS in zero-gravity where you can rotate completely in the X and Y rotations. (As opposed to normal FPSes where you can't spin all the way around vertically)
The mouse look I'm using is this:
var horizontalSpeed : float = 2.0;
var verticalSpeed : float = 2.0;
function FixedUpdate () {
Screen.showCursor = false; //hide the mouse cursor in game
// Get the mouse delta. This is not in the range -1...1
var h : float = horizontalSpeed * Input.GetAxis ("Mouse X");
var v : float = verticalSpeed * Input.GetAxis ("Mouse Y");
transform.Rotate (-v, h, 0);
}
And all of the default mouse look input settings from Edit > Project Settings > Input. The Y axis scrolls too fast and the X axis scrolls really slow, though I would think they would be exactly the same. And when I scroll up or down too far, the scroll speed gets lower all the sudden.
So what's a better script or setting I can change to get the effect I want?
Answer by ocularcash · Sep 27, 2011 at 06:03 AM
the sensitivity for x and y is in your inspector window under mouse look script
Are you talking about horizontalSpeed and verticalSpeed? Changing those does affect how fast they move, but I still get that slow down thing on the vertical axis. And I'm still wondering why having them the same value makes X and Y scroll at different rates.
Answer by ocularcash · Sep 28, 2011 at 07:08 AM
yes. im sorry i must've read your post wrong at first. you can put on the script provided by unity and just tweak the variables in the inspector window. the provided script works pretty good and X and Y moves at the same speed. just go to component/camera-control/mouselook
Answer by crackboom · Sep 29, 2011 at 01:50 AM
I figured out what I did wrong. I wanted the character to rotate so I put the script on the player, but I forgot to take the built-in camera mouse look off the camera component. I had two mouse look scripts running by accident. Oh golly.
Your answer
![](https://koobas.hobune.stream/wayback/20220612224932im_/https://answers.unity.com/themes/thub/images/avi.jpg)