- Home /
What units does Input.GetAxis("Mouse X") use?
I'm trying to make an aim training simulator for Overwatch, and I need to make sure the sensitivity scale in my game match's Overwatch's. To do this, I need to know exactly what Unity means when it says the mouse moved by "0.21" in the x-direciton. What units is that in? Pixels? Dots? Inches? I can't find this information anywhere on google.
Thanks in advance!
Answer by hexagonius · Jan 28, 2017 at 11:43 AM
The docs say:
If the axis is setup to be delta mouse movement, the mouse delta is multiplied by the axis sensitivity
They don't say anything about what the mouse delta would be, but since it's movement and movement is a change in position it should be the position delta, and that's in pixelcoordinates.
So how would that translate to "dots", in terms of dots-per-inch?
@falconfetus8 DPI is a term used in printing. Computers have pixels, not dots, and the delta movement is already calculated in pixels.
Well, I still need to find out how many pixels are in a "dot". The end-goal is to convert a known number of centimeters-per-360 into pixels-per-360. Since I know the dots-per-inch of my mouse, I can convert that to dots-per-360. The next step is to convert that into pixels-per-360, but I need to know how many of these "dots" equal one pixel.
There's no way to know. Different mice have different resolutions, plus user settings and things like mouse acceleration affect it, and there's no API for getting any of that information. The only way to get your mouse movement code to exactly match someone else's mouse movement code is to actually get your hands on that code.
Were you able to reach a conclusion to this? What are the units of the mouse movement - was it inches?
No, it's a dimensionless value since it's usually scaled by an arbitrary sensitivity setting of the OS. However the best match would probably be "pixels" since the cursor is usually simply moved by the delta that comes from the mouse. If you use the mouse input for something else than moving a cursor around it's just arbitrary.