I am getting an error on line 42 saying to insert a semicolon at the end but I am not sure where.
function Start () {
healthRegen();
}
function Update () {
healthtext.text = curHealth + " / " + maxHealth;
if(curHealth < 0 ) {
curHealth = 0;
}
if(curHealth > 100) {
curHealth = 100;
}
void OnCollisionEnter(Collision);
{
if(collider.tag == "enemy")
{
/
}
}
}
function healthRegen () {
for(i=1;i>0;i++) {
yield WaitForSeconds(1);
if(curHealth < maxHealth) {
curHealth++;
}
}
}
↧