- Home /
Erratic mouse Input.GetAxis values on OS X
On a few iMacs here at work, I've noticed that Unity3d occasionally produces really bizarre Input.GetAxis values for Mouse X. Like normal mouse movements would be in the range of 0.1 to 8.0, with big sweeping gestures occasionally hitting 11 -- but on these two macs, I'm seeing spikes of 70 or 90 for no reason. Just small, subtle mouse movements causing Input.GetAxis("Mouse X") to go nuts for a frame or so then it settles back down to normal values. As you can imagine, this makes mouseLook unbearable, as the character will be facing the wrong direction suddenly for no reason.
So, here's my silly debugging code:
function LogMouseErraticBehavior() {
var mouseX : float = Input.GetAxis("Mouse X");
var mouseY : float = Input.GetAxis("Mouse Y");
if (mouseX > 3 || mouseY > 3) {
Debug.Log("mouse x: " + mouseX +
", mouse y: " + mouseY +
", deltaTime: " + Time.deltaTime);
}
}
This may be a clue: the jumping mouse movements only seem to occur while simultaneously strafing with the keyboard. Turning in a circle without touching the keyboard doesn't appear to encourage these crazy values.
Other things I've investigated that may or may not be relevant:
Time.deltaTime seems to be normal. It's not like there's a 0.2 second delay immediately before those mouse spikes due to some background process going nuts. They're sitting at an even 0.012 deltaTime without any real variation.
Swapping mice doesn't help. Both interestingly enough started with logitech mice (rather than apple-branded mice). We tried rebooting after swapping mice with the standard apple mighty mice and a couple generic USB mice we had lying around. Nothing made a difference.
Neither did swapping keyboards..
The problematic iMacs were running OSX 10.7.4 (the latest) with all the recent software updates applied.
Another 4 identical iMacs (same hardware and OS versions) are fine. All the apple laptops we've tried (4), and windows computers (3) are good too.
Full screen vs. windowed doesn't make a difference
OS Mouse sensitivity was set surprisingly low on both machines (about 1/2 of the slider between slow and fast)
Any ideas? I'm pretty stumped.
Your answer
Follow this Question
Related Questions
How to handle Key + Mouse Wheel simultaneously? 1 Answer
Apple Mouse Scroll Wheel 0 Answers
Linux and Mouse Wheel,Linux and Mouse ScrollWheel 0 Answers
How to Move a Cube 3 Answers
OnMouse menu 1 Answer