UCE0001. ';' expected. insert semicolon at end .. but there is one o_O

Hi guys I’m having a similar issue in myHealthControl.J’s script. The affeced line: var healthBar: GameObject.HealthBarGUI.FindWithTag(“HealthBarGUI”);

Tht console says it is expecting ‘;’. Insert semicolon at the end. But I already have. Any help is greatly appreciated.

Also. On a side note, I am a Modeler and concept artist by nature so this coding system is foreign to me. I am willing to barter assets for scrip and script based components. Email me if interested: foresiite@gmail.com Thanks guys!

You should post more code. And you should format that code with the 101/010 button above the edit window.

2 Answers

2

var healthBar: GameObject.HealthBarGUI.FindWithTag(“HealthBarGUI”);

Well, there’s a couple things wrong. Maybe:

var healthBar = GameObject.FindWithTag("HealthBarGUI");

Thank you for the solution.and the advice :-) I will fix this in a second. Also its hard to post the full code because I'm using my phone (just moved so no internet yet) But I do have access for the purposes of uploading content, checking emails, etc. But yes, I am interested in working on assets. Email me: foresiite@gmail.com

You can separate your declaration and initialization to be like this:

var healthBar : GameObject;

function Start(){
healthBar = GameObject.FindWithTag("HealthBarGUI");
}