Why my Gui.button dont are displyed um my scene?
I'll trying to create a menu but my gui's dont show.
using UnityEngine; using System.Collections; using UnityEngine.SceneManagement;
public class Menu : MonoBehaviour { void Start() {
}
void OnGui()
{
GUI.color = Color.white;
if (GUI.Button(new Rect(Screen.width / 2, Screen.height / 2, 100, 25), "BANG!"))
{
SceneManager.LoadScene("first");
}
}
}
Comment
Answer by Landern · Jul 29, 2016 at 01:07 PM
Try changing your method name to reflect the correct casing of the method(documentation stating as much).
You have "OnGui()" above, should be "OnGUI()", case matters.