- Home /
Question by
n931009 · Jun 29, 2016 at 05:42 PM ·
javascriptandroid buildgui-buttonnot showing
GUI.Button works fine in editor but not showing after built (JS)
I drew a button in a script, it's showing in the editor just fine but when I built the game, the button could not be found. I tried scaling it till it fills up the whole screen view but still when I tap the screen, nothing happens. (Built it into android) Here's the code:
GUI.color.a = 1;
if(GUI.Button(Rect(Screen.width - Screen.width, Screen.height - Screen.height, Screen.width, Screen.height), "Collect"))
{
lastCollectionDT = System.DateTime.Now;
lastCollection = lastCollectionDT.ToBinary();
PlayerPrefs.SetString("LastCollection", lastCollection.ToString());
userData.GetComponent.<UserData>().AddCoins(collectionAmount, false, 0);
}
Comment
Your answer
Follow this Question
Related Questions
GUI problems... Cant be specific in title 2 Answers
[Solved]The Right way of doing PopUp 1 Answer
Move the text in a GUI Button/Box 1 Answer
Help with Void Boolean Text problem 1 Answer
controlling rigidbody 2d 0 Answers