Search Unity

Bug Game window mouse offset.

Discussion in 'Linux' started by Kaukamieli, Sep 8, 2015.

  1. Kaukamieli

    Kaukamieli

    Joined:
    Jul 14, 2015
    Posts:
    15
    Mouse cursor is a few centimeters to the left from what it clicks.

    In included screenshot, I'm actually clicking that button, which I know because the color changed to red, even though mouse is nowhere close.
     

    Attached Files:

  2. Bumfluff

    Bumfluff

    Joined:
    Apr 3, 2015
    Posts:
    3
    Yeah, I get the same. Off to the left in both the new UI and screenraycast hit collisions with rect colliders.

    It's proportional to the screen size too. If I choose Maximise on Play, then I have to hit the moles in my whack-a-mole game further to the left than without.

    Using: ScreenPointToRay(Input.mousePosition);

    Ubuntu 14.04

    Cheers
     
  3. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    Yeah same here with new GUI system. It's off by quite a lot!
    Mint 17.2 here.

    Love that we can even try this btw :) So happy!! :)
     
  4. MrMetwurst2

    MrMetwurst2

    Joined:
    Jul 16, 2009
    Posts:
    253
    OK, so I found out what is the problem, but no solution. See attached pic.
    The gap on the left is how far off the mouse is.

    [EDIT]
    I drew the pic wrong. The gap is on the right side of the button. But it should convey the problem OK :)
     

    Attached Files:

  5. Chaoseiro

    Chaoseiro

    Joined:
    Aug 28, 2013
    Posts:
    40
    I'm also facing this problem in the 20150915 build:

    In the EventSystem you can see the mouse position and that it's triggering the button.
    Judging from my layout setup and the others, I believe the mouse position is being calculated from Screen's Bottom-Left corner, and Unity is using that raw position instead of using the mouse offset from the game view's bottom-left corner.
     
  6. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    It looks like some calculations involving the game view rect may not be compensating for the letterboxing to enforce the aspect ratio.
    If this is the case, you should be able to work around by choosing free aspect or by resizing your game view to a matching aspect ratio.
    In any case, we'll investigate.
     
  7. Kaukamieli

    Kaukamieli

    Joined:
    Jul 14, 2015
    Posts:
    15
    Solution for this: Make the game window be same size as the actual game in the window. Somehow the difference makes the offset. The more empty space makes more offset.
     
  8. CSEliot

    CSEliot

    Joined:
    May 9, 2014
    Posts:
    33
    I'd like to bump/second this. Got the same problem, Free Aspect is quickfix.
     
  9. Charro

    Charro

    Joined:
    Oct 5, 2015
    Posts:
    16
    Same problem here, it only happens in Editor mode. In any other Player or build it works, no matter the resolution.
    Also, when choosing "Free aspect" it works too.
     
  10. Tak

    Tak

    Joined:
    Mar 8, 2010
    Posts:
    1,001
    This should be fixed in the 20160106 build - if it's still offset in some situations with this build, please provide precise repro steps, and we'll continue investigating.
     
    unnanego likes this.
  11. unnanego

    unnanego

    Joined:
    May 8, 2018
    Posts:
    199
    I have this problem on win 11 on Unity 2020.3.30 only in the scene menu of the Lighting settings. In the, for example, environment menu it's ok. No problem with 2021.2.15