- Home /
GUI Button doesn't Work on Android
Theres the code - I have no clue why it doesn't work for me, even the example i pasted into the code But, if I click about onehundred times with two fingers on the button it works (or if i click it on the PC with the mousecursor)
OK i just figure out it also works on the mobile device if i hold the button for a secound. How can i fix it, so the button can be clicked/tabbed ?
#pragma strict
var customGuiStyle : GUIStyle;
function OnGUI() {
if (GUI.Button(Rect(100,200,500,70),"START GAME",customGuiStyle)){
Debug.Log("RUN");
Application.LoadLevel (1);
}
if (GUI.Button(Rect(100,300,500,70),"QUIT GAME",customGuiStyle)){
Debug.Log("END");
Application.Quit();
}
if (GUI.Button(Rect(10,70,50,30),"Click"))
Debug.Log("Clicked the button with text");
}
thanks in advance
Answer by BadAssGames · Nov 15, 2013 at 08:25 AM
It has been my experience that Unity Android has a serious issue with android devices that have been jailbroken. If you rooted your android device at some point in time, I suspect this is the case.
To Husky: I've never had any issue with Unity GUI buttons on mobile besides the issue I described above.
Yes, you are right, i've testet it on another unrooted device and it worked without any issues!
Thank you for your help, i will add a text on the Google-Play-Store which mentiones that rooted devices should hold down menu buttons and everything will be okay. ;)