Search Unity

Mouse input in windowed mode (Bug ?)

Discussion in 'Editor & General Support' started by Alucard97, Jan 5, 2018.

  1. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    Hi,

    I'm experiencing an issue where standalone build (OSX) in windowed mode only gets correct mouse input when the window is exactly at the center of the screen. Lets say i have some buttons, when i build my game the window spawns at the center of the screen and i can interact with them just right, but when i move the window the game acts as if i didn't move it.

    the grid is made of buttons, they use basic hover functionality.
    here is how it looks when window is at the center of the screen, it works as expected.


    and here is how it looks after moving the window a little left.


    looks like MousePosition with unity's systems uses is relative to the center of the screen. Is there a way to make it relative to the center of the window instead?

    everything works fine when in fullscreen but it's still a very big problem when you want to make a casual game that you can play in a small window like for example minesweeper. Plz send help

    sorry for my english btw. ^^
     
    Last edited: Jan 5, 2018
  2. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    anyone?
     
  3. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    You might want to post your relevant code. To my knowledge, that's not how it works. Nor have I ever experienced a bug like that or heard about one.
    So, it's most likely your code :)
     
  4. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    I made a very simple test scene and the issue is still there. Care to take a look?

    the package contains a simple scene and a simple script. When i build it in windowed mode results are as described before. Im on osx yosemite 10.10.5 , running unity 2017.1.1f1
     

    Attached Files:

  5. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I don't mind taking a look. Do I have to build to see the problem?
    I'm on windows, with 2017.3.0f3 though.. but we'll see .
     
  6. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Well, for me that sample scene works the same in the editor or build in windowed mode.
     
  7. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    did you move the window of windowed build?
     
  8. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Yep, tried left & right still worked normally for me.
    Does even that sample scene not work right for you?
     
  9. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    unfortunatly yes :/

    so the issue is in my build/player setting or os/unity versions ?
     
  10. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    I am completely unsure because as I said I hadn't heard of it (that's a far cry from saying it wasn't a bug).
    Definitely sounds like a bug, as mouse position should only ever report the 'window' area. File it as a bug report, if you can. They can check the version, I imagine.

    I did a quick google search but couldn't find anything recent early on, so I gave up lol
    You could try upgrading Unity to see if that helps.

    You could try Debugging it to see what kind of values you're getting for mouse position on that simple test scene. Not sure if you could learn anything from that, as this seems like a mystery to me, sorry :)
     
  11. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    I will probably end up reporting this. Anyway, thanks for your help :)
     
  12. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Sorry it wasn't much help. :)

    Report it, optionally debug it yourself for the values, and maybe try updating your unity.

    Also, side question.. if you detach the game view in the editor, does it break there, too?
    if you click + drag the game view tab you can detach it. (personally I like this for testing ;)).
     
  13. Alucard97

    Alucard97

    Joined:
    Jan 3, 2018
    Posts:
    7
    detached game view works fine, the issue is present only in build
     
  14. methos5k

    methos5k

    Joined:
    Aug 3, 2015
    Posts:
    8,712
    Interesting but still super strange. I hope an update fixes it for you.
     
  15. ak05

    ak05

    Joined:
    Sep 5, 2017
    Posts:
    4
    Resizing the window causes the mouse to work OK (until the window is moved again).

    I have the same problem...