GUI Problems

EDIT: Solved.

I want a GUI in my game that just says “Press ‘R’ to Restart”. I don’t need it to pup-up at a specific time or to be clickable, I just need it to be consistently in the top right corner.

This is all I have:

function OnGUI () 
{    
      GUI.Label (Rect (25, 25, 100, 30), "Label");
}

I got this from this page: Unity - Manual: Controls

Later on I will have it so that you can’t see it in the main menu and such, but until then I just want a working GUI.

If you want it to just say “Press ‘R’ to Restart”, then this should work :

function OnGUI(){
// Top-Right Corner
GUI.Label(Rect(Screen.width - 100,0,100,50),"Press R to Restart");
}

It has an error saying “Label is not a member of GUI”.

What’s the name of your script? Try renaming it.

Worked, thanks. The main menu will be a separate scene, so I won’t have any problems stopping it from appearing there.

Cool