- Home /
insert a semicolon at the end??
hello Unity Community, i have this wierd problem with my healthpack script that it ask me to insert 2 semicolon where one is already placed?
anyways heres the script:
function OnTriggerEnter(other : Collider){
if(other.tag == "Player"){
PlayerHealth eh = (PlayerHealth)target.GetComponent("PlayerHealth");
eh.AdjustCurrentHealth(30);
audio.PlayOneShot(Healthsound);
}
}
and heres the 2 Errors :
Assets/Scripts/Healthpack.js(4,29): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/Scripts/Healthpack.js(4,49): UCE0001: ';' expected. Insert a semicolon at the end.
Comment
Best Answer
Answer by robertbu · May 09, 2013 at 01:59 PM
You are mixing C# and Javascript. Try this for line 3:
var eh : PlayerHealth = target.GetComponent(PlayerHealth);
Your answer
Follow this Question
Related Questions
Error in script, when it's not 1 Answer
insert semicolon error 3 Answers
java script problem 0 Answers
Insert Semicolon error 1 Answer
Insert Semicolon error 1 Answer