WorldToViewportPoint GUITexture very glitchy?

No madder what I do, I always get very glitchy behavior when I use a GUITexture and I put this script on it.

var target : Transform; 

function Update () 
{ 

var wantedPos = Camera.main.WorldToViewportPoint (target.position); 
transform.position = wantedPos; 

}

I usually have the target as my enemies and when my enemies move you will notice slight bouncing, also if you move your camera around there is some times slight bouncing and even worse some times it moves around on the screen like crazzy and is no where near the monster.
Then again some times it works just fine.
Anyway its very glitchy and I dont know if its because I have to do something else to it or not.
Is there any way to make it consistently work or another way to do this?
Im using for a health bar on my enemies.

Another way to do this is to use WorldToScreenPoint to get a pixel position and then GUI.Label to draw the text.

Awesome thanks andeeee!
This is for anyone else curious:

var target : Transform;
var Crosshairtex : Texture;

function OnGUI(){
	var screenPos = camera.main.WorldToScreenPoint (target.position);
	GUI.DrawTexture (Rect(screenPos.x - 12,Screen.height - screenPos.y -12,24,24), Crosshairtex);
}

Works good!

How would I align the label in the centre
I tried this but no dice:

var target : Transform;
var healthtex : Texture;
var backgroundtex : Texture;
var script : monsterhealth;
var alignment : TextAlignment ;

function OnGUI(){
	var screenPos = camera.main.WorldToScreenPoint (target.position);
	GUI.DrawTexture (Rect(screenPos.x - 20,Screen.height - screenPos.y,40,2), backgroundtex);
	GUI.DrawTexture (Rect(screenPos.x - 20,Screen.height - screenPos.y,script.healthbarlength,2), healthtex);
	guiText.alignment = TextAlignment.Center;
	GUI.Label(Rect(screenPos.x, Screen.height - screenPos.y,20,20),"Monster");
}

Trying to centre “Monster” but not sure how
Would I have to use a GUIStyle ?

You can centre a label by shifting the XY position by half of the width of the rectangle. Say, the rectangle’s width is 20. You will need to subtract 10 from the X position to centre the label horizontally.

Ok but I was refering to centreing it based on the length of the word “Monster”, I dont know how to get the width of the label based on the length of the word “Monster”. If I did and say it was 20 then yes -10 would work.

You can use GUIStyle.CalcSize to get the rendering size of some GUIContent with a given style. You can get the default GUIStyle for a label using the GUISkin’s label property:-

var labelText: String = "Monster";
var labelStyle = GUI.skin.label;
var size: Vector2 = labelStyle.CalcSize(GUIContent(labelText));

You can then set the width and height of the rect you pass to GUI.Label accordingly and use this to shift the label’s position.