- Home /
Unity 4.6: Convert GameObject into a UI.Button
I am trying to get a UI.Button present in the scene via script. However, I am getting an error message saying that the GameObject cannot be converted into a UI.Button.
Button play;
void Start(){
play = GameObject.Find("Play") as Button;
}
I tried this code and it doesn't work. Is there any way I can acheive this?
Comment