rendering GUIText from Prefab

I’m creating various prefabs that I can reuse for multiple levels of a game. The one I’m working on now is a CountdownTimer. I just want to display a timer on screen that counts down and stops at zero. I’ve got that far, and it’s working well. However, it’s only working with the GUIText object in the hierarchy itself.

I’ve created a prefab with the same functionality/script attached to it, and it also works great (tested using Debug.Log), but I’m not clear on how I’m supposed to get it to show up when the game is running. I can position it anywhere that would otherwise be visible, but it never is. My camera IS set to render the GUILayer…

Have already done some searching, but so far, no luck. These seemed promising, but didn’t get whatever answer I need (or I didn’t understand them):

My prefab consists of a script and GUIText.

Background: Beginner to Unity…but my day job is software development. So explain the Unity concepts very, very slowly… =)

Thanks!

Couldn’t find a way to Make It So…so I changed the approach:

  1. Removed GUIText completely.
  2. Added 3DText (TextMesh) in its place.
  3. In the script, I get a reference to the TextMesh on Start(): textRenderer = gameObject.GetComponent(typeof(TextMesh)) as TextMesh;
  4. In update, set the value of the text: textRenderer.text = string.Format(“{0} {1}”, timeRemaining > 0 ? “Bonus” : “No Bonus!”, timeRemaining > 0 ? Math.Ceiling(timeRemaining).ToString() : “”);

Still needs to be cleaned up some, but it certainly works. Will likely make it so the timer can hover above an area (a checkpoint or the end of a level), or follow the player, too.

Hopefully that can help somebody with the same problem!