- Home /
 
               Question by 
               RJJ92 · May 11, 2015 at 12:19 PM · 
                buttononguigui.button  
              
 
              OnGUI() works on Editor but not on Android Device
It's pretty simple. I'm trying to get Native GUI to make a Menu screen of sorts. And on Editor and Game it works perfectly, but when I export it on the device, it doesn't show.
The script is attached to the Camera, and there's only a Cube in front of it having no other script.
My script is as follows:
 using UnityEngine;
 using System.Collections;
 
 public class newmenu : MonoBehaviour {
     private Rect b;
     void Start () {
         
         int w = Screen.width;
         int h = Screen.height;
         
         //name = new Rect ( px ,py ,bh, bw)
         b = new Rect (w -3*w/4, h - 4*h/5 , 2*w/4, h / 10);
         }
     
     void OnGUI(){
         
         if (GUI.Button (b, "Begin")) {
             Application.LoadLevel("SolidWhite");
         }                        
     }
 }
What am I doing wrong? Even Canvas Buttons do the same thing! OnGui works fine on the other scenes, just this one!
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
[FIXED] Why is my GUI.Button always pressed? 0 Answers
Switch button between accelerometr and gui buttons 0 Answers
How to use if(GUI.Button with Flash? 1 Answer
How to add delay before showing GUI Button? 3 Answers
Making texture cover whole button 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                