- Home /
UCE0001 semicolon expected, please help
I am trying to make the player die upon contact with an object tagged "Monster" but I keep getting this error.
var health = 1;
var takeDamage : boolean;
function OnTriggerEnter(other : Collider){
if(other.tag == "Monster"){
TakeDamage = true;
}
}
function OnTriggerExit(other : Collider){
if(other.tag == "Monster"){
TakeDamage = false;
}
}
function Update(){
if(takeDamage){
health -- 1;
}
if(health <=1){
print("You are dead");
health = 0;
Destroy (gameObject);
}
}
Comment
Your answer
Follow this Question
Related Questions
What am I missing? I already have the semicolon at the end.. 1 Answer
UCE0001 ";" expected. insert a semicolan at the end? 1 Answer
";" expected. Insert a semicolon at the end 1 Answer
UCE0001 error Insert a Semicolon at end 1 Answer
Assets/Scripts/scriptEnemy.js(24,35): UCE0001: ';' expected. Insert a semicolon at the end. 3 Answers