Mouse Position is Incorrectly Offset by Margins

In the Game tab, the scene is displayed with margins on either the sides or top and bottom to “fit” the game view into the tab, depending on the aspect ratio.

Problem is, for some reason the mouse is treated as if these margins don’t exist. Mouse events don’t take into account the fact that the game view is “scooted over” to be centered in the tab. As a result, a button will detect the click even if I click to the far left of the button (see attached screenshot)

This behavior is the same for all click events, and is not unique to buttons or UI elements. If I make the margins disappear by either perfectly resizing the tab or setting the aspect ratio to “Free Aspect”, the mouse position is detected correctly.

It wouldn’t seem like this is such a big deal, except that this happens in builds as well. I created a windows build, ran it in full screen (the view was stretched), and I still had to click to the left of every button or mesh that detected mouse events.

Using Unity 5.1.0f3 64bit .deb build on Ubuntu 14.04.

Can confirm, same setup.

Also can confirm. “+1” :slight_smile: