Creating a text on a surface


have a game object which i want to display an integer variable inside a script...which component to use for the text?

Using Unity Free

use GUI functions

add something like:

var score = 0;

function OnGUI () {
     GUI.Box(Rect(10, 10, 100, 25), "score: " +score);

inside the "" add whatever text you want to show before the number

(if you don't want anything just put "")

Then after "" put +var replace var with the name of your score variable whatever you want to display

Rect(10, 10, 100, 25) <-- you can change these numbers it works like this:

Rect(distance from left side, distance from top, width, height)