NullReferenceException UnityEngine.Camera.WorldToScreenPoint (Vector3 position)

here is my script,the ploblem is:

NullReferenceException UnityEngine.Camera.WorldToScreenPoint (Vector3 position)

#pragma strict

var npcHeight:float;

var hero:  GameObject;

private var  name :String= "我是";

private var myCamera:Camera;


public var  blood_red:Texture2D;


public  var  blood_black:Texture2D;


private var  HP :int=100;





function Start ()

    {

        //根据Tag得到主角对象

        hero = GameObject.FindGameObjectWithTag("test");

      

        

 var size_y:float;

        

size_y = collider.bounds.size.y;

 var scal_y:float ;      

 scal_y = transform.localScale.y;

       

        npcHeight = (size_y *scal_y) ;

 

    }

 







var x:int;

function OnCollisionStay(myCollision : Collision) {
	
	  if(myCollision.gameObject.tag=="stone")
    

HP-=1;



}




function Update(){
transform.LookAt(hero.transform);

}






function OnGUI (){


var worldPosition:Vector3 = new Vector3 (transform.position.x , transform.position.y + npcHeight,transform.position.z);

        //根据NPC头顶的3D坐标换算成它在2D屏幕中的坐标

        var position : Vector2=myCamera.WorldToScreenPoint (worldPosition);

        //得到真实NPC头顶的2D坐标

        position = new Vector2 (position.x, Screen.height - position.y);

       //注解2

        //计算出血条的宽高

         var bloodSize :Vector2= GUI.skin.label.CalcSize (new GUIContent(blood_red));

 

       
var blood_width:int;
blood_width = blood_red.width * HP/100;

        //先绘制黑色血条

        GUI.DrawTexture(new Rect(position.x - (bloodSize.x/2),position.y - bloodSize.y ,bloodSize.x,bloodSize.y),blood_black);

        //在绘制红色血条

        GUI.DrawTexture(new Rect(position.x - (bloodSize.x/2),position.y - bloodSize.y ,blood_width,bloodSize.y),blood_red);



    }

You have not set myCamera anywhere in this code - is it complete? If not, set it like below at Start (or at Update, if the current main camera may change during the game):

myCamera = Camera.main;