how to display distance in scene

how do i display the distance find and display it on the scene.

var obj1 : Transform;

var obj2 : Transform;

function Update () {

    var distance:float = Vector3.Distance(obj1.position, obj2.position);

    Debug.Log("distance =" + distance +"Km");

var obj1 : Transform;

var obj2 : Transform;
var dist : float;

function Update () {

   dist= Vector3.Distance(obj1.position, obj2.position);
}


function OnGUI()
{
GUI.Label(""+dist);
}

Build a GUI with a text label. Instead of using Debug.Log you put the same string in the text label.

If you do not know how to build and use GUIs, read it up in the manual.

:slight_smile: