Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

how do GUIButtons work on android devices?

Discussion in 'Android' started by aixaix, Mar 27, 2014.

  1. aixaix

    aixaix

    Joined:
    May 7, 2010
    Posts:
    523
    How can I make the GUIButton touchable/pressable on my phone`?
     
  2. Agent_007

    Agent_007

    Joined:
    Dec 18, 2011
    Posts:
    899
    If you mean GUI.Button it should work right out of the box.
     
  3. Ian094

    Ian094

    Joined:
    Jun 20, 2013
    Posts:
    1,548
    Simple.

    Code (csharp):
    1.  
    2. function OnGUI(){
    3.  
    4. if(GUI.Button(Rect(0,0,100,50),"Play")){
    5. //Do Something Here
    6. }
    7. }
    8.  
     
  4. aixaix

    aixaix

    Joined:
    May 7, 2010
    Posts:
    523
    Oh, I thought you need to add some other stuff to it... because i wasn't able to click the button through unity remote....
    But thank you guys.
     
  5. Numonic

    Numonic

    Joined:
    Mar 22, 2009
    Posts:
    241