- Home /
OnGUI/iPhone - cannot touch TWO+ buttons at the same time...?
Note - thanks to Goob below, he has told us that "Unity GUI is dependent on only having 1 source - the mouse [x, y]."
(If anyone has a reference or doco on that, it would be great to close the issue.) Cheers!
Building to iPhone or iPad. Using GUI.RepeatButton, make two trivial buttons on the screen.
(Think of them as "Run" and "Fire".) Hold down "Run". Now, while holding "Run", also put your left thumb on "FIre".
The touch on "Fire" is NOT registered.
In other words, it appears that using OnGui/RepeatButton .. in fact you can only read one button-press at a time.
Is this a known problem? Any solutions? Thanks.
{Aside -- For the record: I already realise it is usually said that UnityGUI has poor performance, for mobile. (Interestingly, even in an incredibly complicated scene, we have not found this.) Anyway, I would like to know how to solve this problem with OnGUI, or if it is a known bug/problem. Cheers.)
And -- RIP Steve.
Sounds like OnGUI is using the Input.mousePosition to deter$$anonymous$$e whether a button has been pressed.
Answer by J3-Gaming · Oct 06, 2011 at 11:44 PM
I have also encountered this problem, because your using mobile you have to use the Input.touches array. Unity GUI is dependent on only having 1 source (the mouse [x, y]).
$$anonymous$$agnificent, thanks Goob. You rock. Do you happen to have any reference on documentation on that? That would be great to finally confirm it. Thanks again!
Answer by kgoswami · Oct 06, 2011 at 11:15 PM
Hi I am having the same problem. What I figured was that it actually presses at the mid point of your two touches. put a button in the middle of your two buttons and you will see it being pressed. Can someone please help in this matter. I am also having the same problem
Answer by DaveA · Oct 06, 2011 at 10:43 PM
Worst case you'd have to use Input.touches and roll your own buttons that way.
Your answer
Follow this Question
Related Questions
How to press 2 buttons at the same time 1 Answer
My buttons do not appear when paused? 2 Answers
RepeatButton action upon release 2 Answers
[Old GUI] Buttons on Top not responding correctly on iOS 0 Answers
iPhone Touch Screen? 2 Answers