[Solved]Help With noob Error please!?

This is the script I’m trying to get to work when hover over a object like a button in the game world if anyone could help me?

using UnityEngine;
using System.Collections;

public class button : MonoBehaviour {
   void GUI() {
	GUI.Label(new Rect (25, 25, 100, 30), "E to open Or Close"); 
	}
}

void GUI()

should be

void OnGUI()

OnGUI() not GUI()

Hope this one help you at least a little and good luck :slight_smile:

using UnityEngine;
using System.Collections;

public class New : MonoBehaviour {
	     void OnGUI()
    {
    GUILayout.BeginVertical();
    GUILayout.Button("First");
    GUILayout.Button("Second");
    GUILayout.Button("Third");
    GUILayout.EndVertical();
     
    if(Event.current.type == EventType.Repaint && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition ))
    {
    GUI.Label(new Rect(225, 225, 128, 48), "E to open Or Close");
    }

    }
}
  1. Create new scene in new project
  2. Add new C# script and name it “New”
  3. Copy paste script
  4. Add script to main camera
  5. Play and enjoy :slight_smile:
  6. Don’t forget to come back and tell how it went