gui on objects showes

hey how do i add a gui tekst ontop of an object like a Security device that when i look at the device the gui test appears above the Security device. and says Security Device??

or a player like some first person shooters that the gui says thare names or rank on top of thare head thanks

There are several ways to do this, you can do it through the OnGUI:

Vector3 lScreenPos = camera.WorldToScreenPoint(transform.position); GUI.Label(new Rect(lScreenPos .x, lScreenPos .y, 100,20),"Object");

Note: You will have to manage objects that arent visible (offscreen or behind camera).

Or you could create an GUIText object..