- Home /
Mouse wheel sensitivity different between platforms
Hi.
I am working on a game, and it requires the use of the mouse scrollwheel. I am working on it on a Mac, and it appears to work exactly as I want it to. However, when I try the game on Windows, the mouse wheel seems far less sensitive.
I set a float variable to Input.GetAxis("Mouse ScrollWheel")*60
, and check if it is greater than 40. Mac I am able to reach the if statement, but using the same mouse in Windows, I spin as much as I can, and cannot even get close to 40. I even tried multiplying it by 400 instead of 50, but got very similar results.
How could this issue be fixed? Anyone experienced the same issue?
Thanks in advance
I develop for mobile so I have never came across this, nor do I know how to fix this; but for a solution you can use the #IF UNITY_STANDALONE_WIN and #IF UNITY_STANDALONE_OSX to make two different if statements. $$anonymous$$ake the mac one your if 40 statement and then find the equivalent value for windows to match what you want it to do. I would also do a #ELSE if statement just in case you publish to any other platform and forget to add it to the if statement (like Linux or webplayer) to act as a fail safe.
I know what you mean, and I did think of doing that before. But it just doesn't work in my case. I need to check if it is greater than 40 because it also makes a visual difference. I need to bring the mouse wheel axis to the value of 40 or grater. Doing that means wasting more hours by restarting my computer and copy/pasting the game to an USB stick over and over again.
It could be due to the sensitivity to the mouse itself or the mouse scroll wheel, but I don't think it would effect it as greatly as you are implying.
Windows has a setting for the mouse that allows the user to control how sensitive the mouse wheel is. I usually set $$anonymous$$e to a value of 3 for instance to make websites scroll faster. Normally, you can request the sensitivity value in the windows API, so I would be surprised if this value wasn't something Unity allows you to query through the scripts, maybe have another close look at the input and mouse script references. Also, are you looking for a change of 40 units from one frame to the next? What happens if the game runs slower or faster? What I would do, though this may not fit into your architecture, is keep a running total of the scroll value. So if they scroll forward five times, you add the difference scrolled each time until it hits 40.
Well it would require more work, but rather than blindly multiplying it by x and keep doing guess work, take away the guess work. $$anonymous$$ake a gui component and show what the scroll value is. From there you can easily see what you need to multiply it by. GUI.Label(new Rect(5,5,Screen.Width,Screen.Height), "Scroll value Is: "+FLOATVARIABLE+" || Times 100: "+(FLOATVARIABLE*100));
Answer by MasterTim · Oct 27, 2013 at 09:13 PM
Var mousewheel : int = 0;
If(Input.GetAxis ("Mouse ScrollWheel")> 0){
mousewheel = 1;
} else if (Input.GetAxis ("Mouse ScrollWheel")<0){
mousrwheel = -1;
} else {
mousewheel =0;
}
Inset mousewheel to your line and the multiplier
Your answer
Follow this Question
Related Questions
change tiltshift distance with mousewheel 0 Answers
multiplayer: Change level in 2 different times (first server after player) 0 Answers
Question about mipmapping and downscaling 0 Answers
Use multiple NavMesh ? -1 Answers
mousewheel tilt 1 Answer