How the GUItext works ?

Hey there,

I don't understand how the GUItext thing is working. I have a new project with a GUItext assigned to a simple GameObject. The GUItext has some text but nothing is rendering on the screen.

I found some related topics but nothing specific enough.

I worked with GUI.Label() but it seems that the logic is different ? (you have to assigned the GUItext to an object)

Thx

The two things you mention there are as far as I know not really related. For the GUIText you simply go to your scene and GameObject->Create Other->GUIText. This will create a GUI game object in your scene which is rendered.

The GUI.Label is something that you would place in a script. You create a JS script and put the folling in tehre (from the documentation):

function OnGUI () {
GUI.Label (Rect (10, 10, 100, 20), "Hello World!");
}

This will create a label displaying "Hello World!" at the specified position. So the one option is a game object, the other option is via scripting.

GUIText objects use viewport space, so they must be in the range of 0..1 in order to be visible. Also the camera must have a GUILayer component.