- Home /
Error BCE0044 JavaScript
Hello, i have written a script that declares some variables, when i try to use the script, it gives me the error "BCE0044: expecting }, found 'public'." the "public", by the way, is from a "Public Var". Also, it gives me another error about the end of the script ; BCE0044: expecting EOF, found '}'.
Is there anyone who can suggest how i can get rid of this error?
function start () {
public var levelplayauth1 = false;
public var levelplayauth2 = false;
public var levelplayauth3 = false;
public var levelplayauth4 = false;
public var levelplayauth5 = false;
public var levelplayauth6 = false;
public var levelplayauth7 = false;
public var levelplayauth8 = false;
public var levelplayauth9 = false;
public var levelplayauth10 = false;
public var levelplayauth11 = false;
public var levelplayauth12 = false;
public var levelplayauth13 = false;
public var levelplayauth14 = false;
public var levelplayauth15 = false;
public var levelplayauth16 = false;
public var levelplayauth17 = false;
public var levelplayauth18 = false;
public var levelplayauth19 = false;
public var levelplayauth20 = false;
public var levelplayauth21 = false;
public var levelplayauth22 = false;
public var levelplayauth23 = false;
public var levelplayauth24 = false;
public var levelplayauth25 = false;
public var packplayauth1 = 0;
public var packplayauth2 = 0;
public var packplayauth3 = 0;
public var packplayauth4 = 0;
public var packplayauth5 = 0;
public var HillyPadlock : GUITexture;
public var NightPadlock : GUITexture;
public var HighPadlock : GUITexture;
public var MultiplePadlock : GUITexture;
HillyPadlock.enabled = true;
NightPadlock.enabled = true;
HighPadlock.enabled = true;
MultiplePadlock.enabled = true;
if(packplayauth1 >= 5)
{
HillyPadlock.enabled = false;
}
if(packplayauth2 >= 5)
{
NightPadlock.enabled = false;
}
if(packplayauth3 >= 5)
{
HighPadlock.enabled = false;
}
if(packplayauth4 >= 5)
{
MultiplePadlock.enabled = false;
}
}
That's the code by the way
Answer by robertbu · May 09, 2014 at 05:33 PM
You don't use 'public' for variables declared inside a function. I think you want to declare these variables outside of 'Start()'. Note you have 'start' with a lower case 's'. This will not be called by Unity. You need 'Start()' with an upper case 'S'.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Destroy Other 2 Answers
Unexpected token: private. Error. Can anyone help? 2 Answers
Scripting Error Help Needed 2 Answers
When I kill one enemy, the rest disapear, but still shoot 1 Answer