- Home /
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
Answer by rudolfwm · Feb 17, 2011 at 04:47 PM
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..
Your answer
Follow this Question
Related Questions
How can I have a 1st person and 3rd person camera movement option for the player? 1 Answer
3d object on GUI 1 Answer
move camera gui buttons 1 Answer
Detect a click outside a GUI/object 4 Answers
Playername in 3D World 2 Answers