Simple tutorial that shows you how to create GUI button in Unity using Javascript.
Make a Scene, I called it Menu.
Create a JavaScript file, I named it MenuGUI.
Create a button. Rect makes rectangular at 0,0 two dimensional coordinates. Rectangular size is 200 pixels wide and 100 in height. OnGUI function gets iterated at every frame.
Source code viewer
function OnGUI() { GUI.Button(Rect(0,0,200,100), 'Button'); }Programming Language: Javascript
Create an empty object form GameObject -> Create Empty or simply Ctrl+Shift+N. Attach the script to the empty object.
Make the button do something.
Source code viewer
function OnGUI() { if(GUI.Button(Rect(0,0,200,100), 'Button')) { // Code goes here... } }Programming Language: Javascript