How to attach GUIText to Prefab?

Hi,

I’ve made a prefab with the hierarchy :

Parent:
cube object1,
cube object2, …

Now, I need to add a GUIText to this prefab. But GUIText won’t allow being under a parent (or so I think) as its coordinate system gets messed up and the text is not displaying.

Then I tried attaching a GUIText Component to a child cube game object and initialising that from code. The text value got updated but its still not displaying.

I’m assuming I’ve messed up in initialising some parameter of GUIText (I started Unity very recently) and despite searching for this for 2 days I’m unable to find any solution.

If anybody can help me out I’d be very grateful.

Thanks in advance
Nik

GUI elements are rendered by the camera… Transform position of GUIText is based on screen coordinate between 0 and 1…

If you want to control what appears before the other:
Try using gui.layer and OnGUI() instead of guitext component

http://docs.unity3d.com/Documentation/Components/class-GUILayer.html