Button click area being separated from simple button.

Reproduction steps

  • Create a new project

  • Right click in hierarchy and select to add a TextMeshPro button

  • Move the button to the top right corner and anchor the button to the top right

  • Verify your button works in editor

  • Go to build options and enable resizable window

  • Build and run project

  • Verify button works in fullscreen mode

  • Switch to windowed mode and resize screen to be vertically smaller (should look widescreen on one monitor)

  • Observe the button is now unclickable

  • Move mouse below button and try to find the hover/click area. It should be somewhere below the button8241540--1077762--hoverissue.gif

Gif shows first fullscreen mode, then windowed mode where the window fills the screen, then a resized window where the button breaks.

2 Likes

Anchoring to the top right is not necessary. This bug will affect all buttons on the right side of the screen in windowed mode regardless of anchoring position. The effects become more severe the more the window is shrunk down vertically. This does not effect buttons in the center or left side of the screen.

Tried to upload a zipped project file, but looks like file size is too big for the forums.

I also had the same problem。

Hi all. I ma having this exact issue. I put a button in top right corner and so on. Even if I child it to any element it still happens. Weird thing is, it only happens with 1 button. The rest work as expected. Has anyone got any way to fix this?

The fix mentioned in this bug report has worked for me https://issuetracker.unity3d.com/issues/broken-mouse-pointer-input-coordinates-in-graphicraycaster-for-certain-window-sizes-in-build-when-run-in-windowed-mode

2 Likes

didn’t expect this to be an actual unity bug, but I just googled as the last resort, and boom! nice, I mean “nice” :smile: