Hello. The health bar is not sticking to just the gameobject’s position; it shows up again when the camera is rotated 360 degrees. What am I missing? Thank you
var screenPosition: Vector3 = Camera.main.WorldToScreenPoint(transform.position);
//draw the background
GUI.Box ( Rect (screenPosition.x , Screen.height - screenPosition.y - size.y , size.x, size.y), transform.root.name);
// draw the filled-in part:
GUI.Box ( Rect (screenPosition.x , Screen.height - screenPosition.y - size.y , size.x * barDisplay, size.y),"");