GUI Object Label - hiding when behind an Object

Hello, maybe someone can help clarify for me.

I am trying to use the Object Label foundation started in the Unity Wiki (http://www.unifycommunity.com/wiki/index.php?title=ObjectLabel, but am having trouble when it comes to actually trying to hide the label when behind other objects onscreen. The script uses a GUIText object for the actual label.

I tried a variety of camera depth options and culling, but as a GUI object it is my understanding that it appears on top of everything regardless. Also considered simply hacking in an object label for each item so it behaves when behind another item, but that seemed very long winded. Finally considered testing against a raycast camera to hide/make visible when tested for, but adding in physics when not otherwise needed still did not seem right.

Is there something I am missing/not thinking of?

Jonathan

GUI objects will always be rendered on top.

These are different ways to make labels that are hidden by other objects:

  1. Raycast to where the label is supposed to appear. Requires colliders on any objects that can obscure the label.
  2. Render the GUI label to a RenderTexture Create the label on a secondary camera, render the label to a render texture and create a billboard plane in 3D space, displaying this render texture. Requires Pro.
  3. Create a TextMesh. Create a billboard TextMesh which will create text in 3D space. If you were to also create a billboraded plane behind the TextMesh (probably as a child?), you could add a frame to the labels.
  4. Convert text to a texture and place it on a plane. Through some tool (be it a plugin or call to some web service or a script that you wrote to do image manipulation or something else that's clever) convert your text into a texture and then apply this to a billboarded plane. Requires a mechanism to convert text into a texture.
  5. Create a handle Label. Editor only.