i am having problems making my health bar its very basic and but im a noob. I wouldn’t be surprised if i have done something horrible wrong and blindingly obvious .
so here is my code:
#pragma strict
static var Health : int = 100;
var HealthNow = 100;
var pos = transform.position;
// Use this for initialization
function Start () {
}
// Update is called once per frame
function Update () {
if(Health < HealthNow);
{
pos.x + 1;
transform.position = pos;
var HealthNow = Health;
}
}
my error is
Assets/health.js(14,20): BCE0034: Expressions in statements must only be executed for their side-effects.