Search Unity

UI Buttons click areas are offset at lower resolutions for all projects.

Discussion in 'UGUI & TextMesh Pro' started by cousinoer5, Jun 13, 2015.

  1. cousinoer5

    cousinoer5

    Joined:
    Jun 13, 2015
    Posts:
    1
    I noticed with running our own project and the unity sample project that as we lowered the resolution of our build, the buttons' click areas start drifting to the left, but the buttons were in the same place visually. At 1600x900 it works just fine, which is strange. This happened on multiple computers, and different projects, including starting a new one and just placing a button that lights up when you mouse over. Even the sample project has this issue, so I'm wondering what we can do to fix this, if we can fix this, and if this is a known issue. Attached is a picture of our test button, and the red outline is where the actual click area is at lower resolutions. Any help is appreciated, thank you for your time.

    button woes.png
     
    Emilian0 likes this.
  2. Alabatross

    Alabatross

    Joined:
    Dec 15, 2012
    Posts:
    223
    I'm still getting this bug on 5.3, is there a way to fix it?
     
  3. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Try 5.3.1p3. Its likely related to the multiple display bug we fixed.
     
  4. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    5.3.2f1 and i still have that problem. Edit: this seem to happen when the recttransforms anchor preset is set to the lowest right one (the stretch-all-thing). When it's set to the center-all-thing it works normally.
     
    Last edited: Feb 7, 2016
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Can your share an example project?
     
  6. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    Which buttons? What resolution should i test with?
    Looks like you have got your anchors set up in a strange way, this only seems to work with a 16:9 aspect for me, anything else and the UI is a mess. The buttons brain, skill and build have a lot of white space covered by the rect that will allow for clicks which may be the problem you have.
    upload_2016-2-7_17-45-44.png
     
  8. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    No specific resolution, but 16:9, yes. The 3 buttons shown have that problem. And it's not that the whitespace is clickable, it's that somewhere in that whitespace -only- that space is clickable. I recorded it:
     
  9. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    The video is private.
     
  10. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    sorry, should be visible now
     
  11. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    The gameobject 'Image' is blocking the clicks. Turn off Raycast target.
     
    browne11 likes this.
  12. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    945
    Oh, i'm sorry. What a silly mistake.
     
  13. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,292
    No problem. Just happy it's not a bug :D
     
  14. pirou

    pirou

    Joined:
    Jan 29, 2015
    Posts:
    6
    Hey, i am currently having an offset problem with the new UI but i am not sure if it's a unity related bug.
    Can you check this out?

    i am encountering a problem on Android: I am using the AR plugin ARToolKit and i upgraded to unity 5.3.5 hoping it would solve this. I created UI features to display stuff when i detect markers, exported the project into android studio and i created a banner as native android. When i run it full screen with android studio, the clickable part is great and the buttons work fine but when i inflate my banner, the clickable area is offset by the height of my banner, it's like the clickable area is set from the top left corner instead of being set up from the bottom of the banner.

    Did you find a solution? On the pictures, i illustrated approximately the clickable area i have
    You can see the picturesi llustrating this problem here : http://answers.unity3d.com/answers/1216346/view.html
    and related articles here : http://answers.unity3d.com/questions/978393/screen-resolution-offsets-cursor-and-buttons.html
    https://issuetracker.unity3d.com/is...which-aspect-ratio-is-different-then-monitors

    Any news?
     
  15. Athomield3D

    Athomield3D

    Joined:
    Aug 29, 2012
    Posts:
    193
    7 years later still same problem lol
     
    HWinsen, Egoist_one and jaksilver like this.