move a gui element relative to a 3d objects position?

So I want to make a monster healthbar thats displayed on the gui move when the monster on the screen moves. how can i turn the 3d point into a 2d point on the GUI?

For a GUITexture object, use Camera.WorldToViewportPoint; have a look at this script on the wiki. (It uses GUIText rather than GUITexture, but can be easily adapted.) If you were using OnGUI, you'd use Camera.WorldToScreenPoint, although you'd have to invert the y, since the screen space in OnGUI uses top-down rather than bottom-up.

how did you make the healthbar?

Hey ppl im just asking no need to vote -2!