the error Assets/cubeAI.js(2,11): UCE0001: ‘;’ expected. Insert a semicolon at the end. keeps coming up. heres my script.
var health - 10;
var TakeDamage : boolean;
function OnTriggerEnter(other : Collider){
if(other.tag == "Player"){
TakeDamage = true;
}
}
function OnTriggerExit(other: Collider){
if(other.tag == "Player"){
TakeDamage = false;
}
}
function Update(){
if(TakeDamage){
if(Input.GetButtonDown("Fire1")){
health --;
}
}
if(health <- 1){
print("Enemy Down!");
health - 0;
Destroy (gameObject);
}
}
and i do have a semicolon. im a newb watching tutorials on youtube. i cant continue with the tut until i fix this so please help.