World to Gui problem

I'm trying to do a toggleable display for npc info in a game I'm working on. I went around the forums and it seems like most examples use some form of Camera.WorldToScreenPoint. I tried this and I'm having some wonky issues. The GUI only really appears in the proper place when it's in the center of the camera. I'm using Unity 2.5 on a Windows XP(32) machine, and C#

In my scene I've got an empty game object parented under some enemies in my scene that is feeding in it's transforms to the following script:

using UnityEngine;
using System.Collections;

public class Healthbar : MonoBehaviour 

    public Texture2D controlTexture;
    public Transform anchorPos;
    static bool allOn;
    public bool active;

    void Start()

    void OnGUI () 
        if(active || allOn)
            Vector3 screenPos = Camera.main.WorldToScreenPoint(anchorPos.position);
            GUI.BeginGroup (new Rect (screenPos.x, screenPos.y,120,50));
                GUI.Label(new Rect (0,0,    120, 50) ,controlTexture);
                GUI.Label(new Rect(10,5,120,50), "1000 m/s");
                GUI.Label(new Rect(80,5,120,50), "200m");
            GUI.EndGroup ();

I've tried using ScreenToGUIPoint in the conversion too, and it didn't help. I've also tried WorldToViewportPoint which also didn't seem to resolve the problem...It's probably something really simple that I'm missing. any ideas?

So I found the issue.

When working in GUI space (0,0) is located in the upper left-hand corner.

The WorldToScreenPoint() however returns the value as if (0,0) is located at the bottom left.

So to resolve everything I just had to change one line from:

GUI.BeginGroup (new Rect (screenPos.x, screenPos.y,120,50));


GUI.BeginGroup (new Rect (screenPos.x, Camera.main.pixelHeight-screenPos.y,120,50));

Hope this helps anyone who has a similar problem in the future =)

Whoa, welcome to the forums fellow SF resident! I can't really add to this as you've sorted things out, I just thought I'd say hello. :)