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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Button hitbox offset from actual button

Discussion in 'UGUI & TextMesh Pro' started by jc_crash, Aug 20, 2019.

  1. jc_crash

    jc_crash

    Joined:
    Jul 30, 2019
    Posts:
    21
    Hi all,

    I see several people have asked similar questions in the past, but none seem to address the problem.

    I have set up a basic UI in my scene. I have a canvas which is set to render in Camera Screen Space and I have selected the correct camera. I have added a button to my canvas. If the button is in the center of the screen, it all works perfectly. When I move the button to, for example, the left side of the screen, the button hitbox appears to move more as if it is somehow scaled incorrectly. So the right side of the button would not highlight (or click) the button. It is then the same moving in other directions (i.e. moving the button down moves the hitbox lower than it should be).

    Does anybody know what the issue might be? I'm trying to build for WebGL but the issue is present even in the editor. Any help is appreciated.

    Cheers!
     
  2. jc_crash

    jc_crash

    Joined:
    Jul 30, 2019
    Posts:
    21
    Hi all,

    I did not manage to solve this particular problem and still do not know the cause for the button hitboxs moving futher than the button. However, I just reverted back to using screen space overlay UI and it seemed to fix the problem. If anybody happens to find anything It would be good for people to know.

    More info: I tested with the anchors set to the center of the screen. I believe I also tested with anchors set to edge and corner of the screens and had similar behaviour.

    Cheers!