- Home /
UI Button click Position different to actual position
Hey,
I'm using unity 5.1. I have a problem with the Button click position.
If I run the project on my native resolution which is 1920x1200 everything is fine but as soon as I choose a different resolution, the actual click on a Button is completely wrong. It is like the Button is drawn at x=10 y=10, but the click is not the same position as the button. so to click the button I have to click in empty space. What can that be? Seems like a mouse transformation bug, and I do not use own code. I use the onclick handler of the UI Button element.
Can someone help me?
Hi
What I got from you question is Button is remaining at the same position as it was... If this is the problem then pls set the anchor points at proper position sot that they components retain their position.
Second If there is any other problem then please post the screenshots both correct one with 1920x1200 resolution & second screenshot with incorrect button
When i have normal monitor resolution 1600 x 900
when i have 800x600 and first put window mode true and later false and return i see this
the all buttons not work
i use this code
first start on full screen 1600x900
later use this
Screen.SetResolution(800,600,false);
and later use this
Screen.SetResolution(800,600,true);
and the buttons not work
Hi
Thanks for the screenshot now what I am getting from the screenshot is they are scaled down when you change the resolution of the monitor.
can you please confirm this.
you have to set the properties of the canvas like this
Please message if this work or not ..
Try to update the Unity ... Because I'm also using the Unity 5.1.1f1 & 5.1.1p1 .. my mates are start using unity version 5.1.2 .. but I think we are not getting the such type of bug as you are saying .. So try this last solution, may be it works.
Issues we are facing are like mask is not working in mobile, buttons & 3D models are leaving their frames behind if we are changing the color of the Camera. But we have alternates for that so we are happy. But unity 4.6.x (above 4.6.2) are great versions if you have your projects on that version so go for that one.
Answer by Nyozz · Aug 17, 2015 at 09:45 PM
I tested everything and it is definitely a bug. I created a new scene, added a UI button and a click handler and problem still exists. So its no third party sourcecode its unity. Buttons appears on the right position. But the actual click is on different position. I used no source.
So i'm guessing its a bug. It doesnt appear if I choose the exact same resolution I developed the game with in playmode.
Check the following link, I think some other peoples are also facing the same problem
answers.unity3d.com/questions/1028964/unity-5-new-ui-button-colliders-moved-to-the-left.html
Your answer

Follow this Question
Related Questions
World UI elements not render correctly on multiple monitor. 1 Answer
UI - Remembering Last Highlighted Button after Navigation 0 Answers
How to render canvas with screen space - camera on top of canvas with screen space - overlay? 2 Answers
TextmeshPro Glow not working when hitting on play. 2 Answers
Problems getting UI elements to activate/deactivate on mouse over? 1 Answer