- Home /
The Button in the middle activates if i press two side of the button.
Hello,
Like in the topic, that is my issue. If i press "1" and "2" buttons at the same time, "SELECT" button activates. Of course it is not on editor. It happens on android device. How can i prevent this?
Thanks.
Can we see your code, or an editor example? It's really difficult to help with just a disembodied picture of buttons.
Your "select" probably has (Input Touch Count = 2) assigned.
This happens when unity translates the touch input to input it would expect from a mouse - basically it takes the average position of all touch points and uses this as input.
You can maybe prevent it by actually reading the touch input on android and only allowing the button to be pressed when there is only a single touch point. But the question is, does that really break the game in a way that justifies the work.
Here is my codes for the buttons. Sorry for the late answer.
if (GUI.Button (selCharacter.rect, "", skin.GetStyle("selectCharacter")))
{
//
}
if (GUI.Button (nextB.rect, "", skin.GetStyle("nextButton")))
{
//
}
if (GUI.Button (backB.rect, "", skin.GetStyle("backButton")))
{
//
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613163418im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Why this simple code doesnt work? 0 Answers
GuiTexture (Touch button) unfollow camera! 1 Answer
Unity buttons touchscreen woes 0 Answers
[closed]OnClick with touch 1 Answer
Buttons less responsive inside scroll rect with touch controls (UGUI) 2 Answers