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.().AddCoins(collectionAmount, false, 0);
}
↧