Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Our response to Improbable’s blog post (and why you can keep working on your SpatialOS game). Read more here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Good Ole Input.GetAxis and Cursor.LockMode

Discussion in 'Linux' started by KnuckleCracker, Jan 10, 2019 at 6:31 PM.

  1. KnuckleCracker


    Dec 27, 2011
    This has been a problem in the past (from what google tells me). But seems it was fixed sometime around unity 2017. I test linux about once a year, so here I find myself.... Anyway, before I log a bug into the abyss, I'm curious if anyone else has encountered this issue.

    2018.2.17 and 2018.2.20 tested.
    Set Cursor.lockState = CursorLockMode.Locked. Now call Input.GetAxis("Mouse X").
    You don't get back 0.1, or 0.5, or 1, you get back 3000, or more.

    Set Cursor.lockState = CursorLockMode.None (or Confined). Call Input.GetAxis("Mouse X").
    You get back 0.1, 0.2, etc. as expected.

    Only happens on Linux (I tested using Ubuntu 18). Windows and Mac OS are fine. Only happens when the cursor is locked (as one is apt to do for implementing a mouse driven camera look).