Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Macbook problem: Touching trackpad disables Input.GetAxis("Mouse X") by mouse

Discussion in 'Scripting' started by Gord10, Jun 28, 2016.

  1. Gord10

    Gord10

    Joined:
    Mar 27, 2013
    Posts:
    142
    I apologize that this is my second post, I had opened a thread in OSX Platform page. But I got no response and we are having a serious issue.

    We are working on a multiplatform FPS and using the standart FPS codes. On Macbooks, we have a problem. If the player touches the trackpad, we can't look around with mouse anymore. It seems like Input.GetAxis("Mouse X") no longer reads mouse movement. Though, when we press escape and open the escape menu, the mouse works just fine.

    I also tried it with an empty project that uses the standart FPS assets, I got the same results.

    How can we solve this? Thanks in advance!
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,840
    It sounds like maybe you have the mouse cursor hidden, which would obscure what's going on. So I would start by unhiding it.

    The way it should work, when you have both a mouse and a trackpad, is that they both work for moving the mouse. But your Mouse X input axis probably isn't set up to return the position, but rather the delta (i.e. "Mouse Movement"). I'm not sure how Unity is doing that under the hood — it sounds like it's getting confused, but I've never tried it myself.

    I take it that once you get into this state, you can still look around using the trackpad? Just not the physical mouse?

    Really grasping at straws here, does this occur with both a wired (USB) mouse and a wireless (bluetooth) one?
     
  3. Gord10

    Gord10

    Joined:
    Mar 27, 2013
    Posts:
    142
    Mouse cursor is not hidden. I tested it in an empty scene that only shows the input data on screen. It works perfectly on Windows (editor and executable), on Mac editor as well, but not in Mac executable.

    "I take it that once you get into this state, you can still look around using the trackpad? Just not the physical mouse?"
    Yes, trackpad works perfectly. It reads GetAxis("Mouse X") data.

    I think this is a problem about Input.multiTouchEnabled. It is set as true in Windows editor-executable and Mac editor. But false in Mac executable, in which I have this problem. I am looking for a way to set Input.multiTouchEnabled myself.
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,840
    If you've got it pared down to a very simple example, then I would think it's time to submit a bug report.

    As far as I know, Input.multiTouchEnabled is not something you set — it's just a report on what Unity thinks of the system it's running on.