Gui over object?

How would i put a gui texture, such as a health bar, over an object. i want it to be able to move around with the object. im unable to find anything that could help me on the scripting reference.

Try this...it's for GUIText, but you can modify it to use GUITexture instead.

thanks man... this should work, but when i put the code in then a "NullRefenceExeption" keeps popping up in the debugger. any idea why? here is the code that is messing up. it's in javascript.

var player_ob : GameObject;

player_ob = GameObject.Find(“Swat”);

var cam : Camera;

cam = Camera.main;

var cam_pos : Transform;

cam_pos = transform;

cam_pos.position = cam.WorldToViewportPoint(player_ob.transform.position);