So im trying to position this healthbar over a players head using Camera.WorldToScreenPoint, It follows the players X position but as the player goes up and down on the screen the bar does the opposite.

if the player goes up, the bar goes down. if the player goes down, the bar goes up.

heres the code ive written right now, its just being used currently to get the positioning right, and ill add in the missing stuff later.

im trying to fix it, the X axis works correctly, but the y axis is inverted. i would have assumed grabbing the screen coordinates from the player, if the player were to go lower on the screen the bar would follow, however the opposite is true.

I would greatly suggest NGUI and the energy bar toolkit.
I used to create my health bars, and position a guitexture manually over the object, but this created extra draw calls (about 3 per bar) for all of my objects. If you ever plan on mobile or on lower end pc's, I would suggest optimizing the draw calls into a batch. Ngui supports this natively.