- Home /
Wrong button detection at low resolition
Hi there, I start to convert my old NGUI project to new Unity 5 ui. But I have a problem with mouse detection at 1024x768. Is I start the game from the build in Fullscreen mode the mouse detection collider of a simple button isn't aligned with the button texture. there are no problem in editor mode.
I've encountered this as well with Unity5 and Windows 8.
The problem occurs when the game is run fullscreen in a resolution not fit for the monitor ratio, i.e. the monitor is 16:9 and you select resolution 640x480, which is 4:3.
The problem will not occur if you select any resolution with same ratio, i.e. if your monitor resolution is 1920:1080 (16:9), the problem will not occur as long as you select resolutions 1920:1080, 1280:720, 1600:900, etc., as they are all 16:9, or you run any resolution in windowed mode.
The problem doesn't occur in the editor.
Answer by Yury-Habets · Jun 18, 2015 at 06:15 AM
Does this happen on Standalone build? Which version of Unity are you using? (if this is the latest available, please report a bug and attach your simple project to the report).
Answer by Artichoke121212 · Jul 06, 2015 at 08:03 AM
This is a known bug: http://issuetracker.unity3d.com/issues/button-position-is-wrong-on-fullscreen-player-which-aspect-ratio-is-different-then-monitors
For a temporary fix, run the app in the same aspect ratio as the monitor.
Answer by SilverStorm · Jul 11, 2016 at 12:52 PM
Disable "Use Dx11" in the player settings, that fixed it for me on all resolutions it works now.
Your answer

Follow this Question
Related Questions
How To Scale GUI Based On Screen Resolution 1 Answer
GUI.Box NullReferenceException 0 Answers
Unity UI never stays in place 1 Answer
UI working fine in editor but glitched in standalone builds 1 Answer
Changing a GUI Button's font in code 1 Answer