C# Floating Health Bar

I had this working but I messed up and now im very frustrated… so any help please… I need a script working in C# to have a GUITexture float above a gameobject! Please and thank you!!

Take a look at WorldToScreenPoint

 Vector3 screenPos = camera.WorldToScreenPoint(player.position);

Then you can use screenPos to set your texture on the right position

You can set your texture transform parent as the GameObject you want it to follow.
For example:

public GUITexture healthBar;
public GameObject healthyObject;

void Awake()
{
    healthBar.transform.parent = healthyObject.transform;
}

It is just an coded example for this situation, you can also put the texture as child of the GameObject by the Unity Editor.

Setting it up, the health bar position will be related to the object position.