Search Issue Tracker

Won't Fix

Votes

18

Found in

2018.3.10f1

Issue ID

1141732

Regression

No

Button's hitbox is offset when building standalone project for two screens

Windows

-

Reproduction steps:
1. Open the attached build of the project named "Build_1141732_New"
2. Select a non-native screen resolution
3. Start the game
4. Move the mouse over one of the buttons on the second screen

Expected result: Button's hitbox is inside the button
Actual result: Button's hitbox is offset

Reproducible with: 2018.3.8f1, 2018.3.12f1, 2019.1.0f1, 2019.2.0a11
Not reproducible with: 2017.4.25f1, 2018.3.7f1

Notes:
1. The bug only happens when the build is running with a non-native screen resolution
2. This is an existing issue (not a regression) which was masked by another bug:
https://issuetracker.unity3d.com/issues/primary-screen-window-size-turns-to-native-when-using-more-than-one-display
it preventing setting a non-native resolution and thereby kept this issue from manifesting

  1. Response avatar

    Resolution Note (fix version 2019.3):

    When using Multi-Display, all the displays need to have the same Resolution (screen size) in order for the UI to work properly across all screens. If the Resolution on the secondary display(s) is different than the primary screen, the UI will not respond properly to pointer input. This problem is also present in Mac when using a Retina and non-Retina display in a Multi-Display application.

    This occurs because mouse/pointer coordinates used by the UI are scaled and offset according to the screen size of the primary display and not the display the UI actually resides in. So, if the secondary display has a different Resolution than the primary one, the mouse position is scaled/offset incorrectly causing misalignment with the UI controls.

    This issue has always been present with Multi-Display, but in the 2017.4 release the problem was masked due to a separate issue: https://issuetracker.unity3d.com/issues/primary-screen-window-size-turns-to-native-when-using-more-than-one-display. In that case, when Multi-Display was activated it always reverted to the native monitor resolution and ignored whatever resolution you specified. Therefore, assuming both monitors had the same native resolution, the UI worked properly because the app wasn't actually using different screen resolutions.

    To work around this problem with Multi-Display, ensure all display have the same Resolution or screen size.

Comments (7)

  1. 8b94b9228dc7bf8ee4bac59a23d6cccc?d=mm

    adamschule85

    Aug 07, 2019 07:18

    Nice response in return of this issue with firm arguments and explaining everything on the topic of that. https://games.lol/applist/keyword/city-growing-touch-in-the-city-clicker-games

  2. C09be2eb10cb13ef07c19119725a0bff?d=mm

    Pitou22

    Jul 18, 2019 16:42

    I confirm this problem, still present on 2019.1.10f1 ...

  3. 1bc6c497ee2f2ea26fac0c6aa2a40f70?d=mm

    unity_92f75KLGQnUMfA

    Jun 19, 2019 09:08

    Same problem here. Using ScreenSpace - Camera does not help either.

  4. F5493cd2254fd004d5162a0b1d8e018e?d=mm

    JG-Denver

    Jun 19, 2019 03:01

  5. 24fb96d62974241b9f97039209a0b68b?d=mm

    m4d

    Jun 18, 2019 23:02

    We're having the same problem right now with ui controls (buttons, sliders, dropdowns) not receiving their raycasts when on a secondary display which has a different resolution than the first one.

  6. Dd7ef2a132457098cfcd5ab84cc5d402?d=mm

    yezzer

    Apr 11, 2019 10:27

    We are also experiencing this issue, it's making multi-monitor projects difficult to work on.

  7. 330f298f5a80f501edf5616aab002a12?d=mm

    tabulatouch

    Apr 10, 2019 18:50

    I confirm this nasty problem, it is highly problematic on multi-display Windows system with different resolutions.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.