# Mouse sensitivity varies on different computers??

Hello guys,

I was just testing my FPS game on a laptop and discovered that the mouse sensitivity was much, much greater on the laptop than it was on my main PC. This was really strange to me because I know that I used Time.deltaTime, so it can’t be framerate-related. Nonetheless, the camera would rotate like crazy from the smallest mouse movement on the laptop. On the PC, everything works flawlessly.

If it helps, these are the specs of my PC:

Intel Core i5-12600k
RTX 3060 ti
32 GB ram
1 TB SSD

And the laptop:

Intel Core i7-9750h
GTX 1650
16 GB ram
1 TB SSD

And here’s the basic script I wrote for looking around:

``````using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Look : MonoBehaviour
{
public float sens, fov;

Transform orientation, camPos;

float xRotation;
float yRotation;

void Awake() {
orientation = FindObjectOfType<Move>().transform.GetChild(0);
camPos = FindObjectOfType<Move>().transform.GetChild(1);
}

private void Start() {
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
Camera.main.fieldOfView = fov;
}

private void LateUpdate() {
// get x and y mouse inputs
float mouseX = Input.GetAxisRaw("Mouse X") * Time.deltaTime * sens;
float mouseY = Input.GetAxisRaw("Mouse Y") * Time.deltaTime * sens;

// set rotations
yRotation += mouseX;
xRotation -= mouseY;

// clamp x rotation
xRotation = Mathf.Clamp(xRotation, -90f, 90f);

// rotate cam and orientation
transform.rotation = Quaternion.Euler(xRotation, yRotation, 0);
orientation.rotation = Quaternion.Euler(0, yRotation, 0);
transform.position = camPos.position;
}
}
``````

Do you guys have any ideas on why this might be happening? Maybe I’m just being dumb, but a fresh pair of eyes always helps.

1 Like

Every mouse model is different, so you might have to be cautious of settings for your mouse/touchpad also. I have a high end gaming mouse where I can adjust things on it and a cheap mouse where it’s just one setting, so they behave differently, even when I’m just inside Windows, let alone games.

1 Like

I’ll tweak the settings on my laptop a bit more, but I don’t think that is what is causing the issue. I also tried gathering input in Update() rather than LateUpdate(), but it didn’t make a difference. I tried testing a few other FPS games from Itch.io, and they worked just fine on both the PC and laptop with the same mouse. Hmmm

UPDATE:

I found the problem. Apparently Input.GetAxisRaw is already framerate independent, so multiplying it by Time.deltaTime was what actually caused the difference in sensitivity. Very strange, but at least I got it working now.

1 Like

Well, it’s not really strange since it’s the direct mouse delta since the last frame. This has a direct physical relationship to how much the mouse actually moved between two frames. So it actually makes sense to not use deltaTime here. You use deltaTime for values that are given in a time relationship. Like a velocity that is given in units per second. Multiplying by deltaTime gives you units per frame which is what you need when you do something every frame. Since the mouse delta is already read in a per-frame basis, there’s no need to convert anything.

1 Like