starting a GUI, I am a Unity Beginner

Hello Unityrs,

I would like to practice in creating GUIs with Unity. now, I created an empty project, the scene is empty as I need to populate it with my own 3D objects. I clicked on Project->Create Script -> Javascript and created a JS with the Update() function. Now, I copied one of the example in the manual and I hoped to see something, but nothing happens.

What shall I read to kick off with the GUI?

Many thanks Giancarlo

Try the GUI Scripting Guide. It's full of examples and easy to read documentation.

Attach the script to some object in the scene; an empty object is fine. Monobehaviours (such as Update) need to be on an object to run.

Here is a slider going through an array of strings, letting you know when the slider has moved far enough to select a new value. (Had to remove some stuff, so you might need som light debugging to get it to work).

import System.Math;

private var sliderContentStrings=new String["First", "Second", "Third"]; // Try adding more things here.
private var scrollPos:Float;
private var currentSelectedInt:int = 0;

function OnGUI(){

   if (sliderContentStrings.length > 0) {

    this.scrollPos_d = GUI.VerticalScrollbar (Rect(10, 10, 20, 600), this.scrollPos, 1, 0, sliderContentStrings.length);

                if (Math.Floor(scrollPos) != currentSelectedInt) {
                    currentSelectedInt = Math.Floor(scrollPos_d);

                    Debug.Log ("There is change!" + sliderContentStrings[currentSelectedInt]);