i followed this guys youtube tutorial but i got an error but he didn’t, i always have problems with unity and i follow the tutorials 100% every step but i get these small annoying errors, any help with this script would be Great! ERROR: Assets/Enemy Health.js(1,11): UCE0001: ‘;’ expected. Insert a semicolon at the end.
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 - - 1;
}
}
}
if(health <- 1){
health - 0;
Destroy (gameObject);
}