- Home /
Insert semicolon at the end?
function SetFire(PlayFire : boolean)
{
var FireMinSize : float=0.00;
if(PlayFire == true)
{
GameObject.Find("InnerCore").particleEmitter.emit=true;
FireMinSize=((Mathf.Abs(currentSpeed)/100)+1);
GameObject.Find("InnerCore").particleEmitter.min size=FireMinSize;
}
else
GameObject.Find("InnerCore").particleEmitter.emit=false;
}
This is the section of the code I'm having problems with. It says I should insert a semicolon at line 142, column 65 - "...particleEmitter.min size=FireMinSize;" but as you can see I have a semicolon here. Could it be because I'm using GameObject.Find? How could I correct my code? Thanks.
Found the answer, I was trying to acces somethig that doesn't exist :)) it's not "min size" it's "minSize". :D
Answer by oliver-jones · Nov 24, 2010 at 06:24 PM
try this:
function SetFire(PlayFire : boolean)
{
var FireMinSize : float=0.00;
if(PlayFire == true)
{
GameObject.Find("InnerCore").particleEmitter.emit=true;
FireMinSize=((Mathf.Abs(currentSpeed)/100)+1);
GameObject.Find("InnerCore").particleEmitter.min size=FireMinSize;
}
else
{
GameObject.Find("InnerCore").particleEmitter.emit=false;
}
}
You had a few missing }
Just to elaborate - sometimes Unity will tell you theres a ; missing when mostly we forget to close off a function with a }
In this case, no, there isn't any missing brackets. The only error was the space in the middle of the variable name
Answer by Unamine · Mar 26, 2011 at 02:14 PM
The error should be in this part: GameObject.Find (InnerCore). particleEmitter.min size = FireMinSize;
min is separated from size, they should be together or with a point between the two
Your answer
Follow this Question
Related Questions
Scripting error: ';' expected. Insert a semicolon at the end. 2 Answers
doing force and spin on a gameobject when clicking on plane. 2 Answers
UCE0001: ';' expected. Insert a semicolon at the end. 2 Answers
Using JavaScript and C# inside one script 2 Answers
help with UCE0001: ';' expected. Insert a semicolon at the end 3 Answers