hey i want to creat a health bar i follow this guy Unity 3d tutorial -Gui Healthbar p3 - YouTube but unity give a error “Null Referenc Exception”
static var healthcount:int=100;
var health00:Texture2D;
var health10:Texture2D;
var health20:Texture2D;
var health30:Texture2D;
var health40:Texture2D;
var health50:Texture2D;
var health60:Texture2D;
var health70:Texture2D;
var health80:Texture2D;
var health90:Texture2D;
var health100:Texture2D;
function Start () {
}
function Update () {
var healthtexture = gameObject.Find(“health 100”);
Healthcount=20;
if(Healthcount < 30){
Debug.Log(“hello”);
healthtexture.guiTexture.texture = health20;
}
}