- Home /
[Closed] MainMenu Script error
Hello! I am trying to make a MainMenu for my game, then i saw this error on my console. i have been trying to find a solution for an hour, but i just get more and more errors.
Error:Assets/scripts/MyGraphics(MyMenuCNT).js(25,30):BCE0044: expecting :, found '='
Please Help!
This is the script that wont work:
var buttonColor : Color = Color.blue;
var BackgroundColor : Color = Color.blue;
var Horizslidervalue : float = 0.0;
function OnGUI (){
GUI.contentColor = buttonColor;
GUI.backgroundColor = BackgroundColor;
if(GUI.Button (Rect ((Screen.width/2)-350,(Screen.height/2)-50,80,20), "Graphic Settings")) {
QualityOn();}
if(chooseQuality){
GUI.Label(Rect ((Screen.width/2)-200,(Screen.height/2) - 100,100,40), "Quality Settings");
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-50,80,20), "SuperLow");{
QualitySettings.currentLevel = QualityLevel.Fastest;
chooseQuality = false;}
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-100,80,20), "Low");{
QualitySettings.currentLeve = QualityLevel.Simple;
chooseQuality = false;}
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-150,80,20), "$$anonymous$$edium");{
QualitySettings.currentLevel = QualityLevel.Good;
chooseQuality = false;}
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-200,80,20), "High");{
QualitySettings.currentLevel = QualityLevel.Fantastic;
chooseQuality = false;}
if(GUI.Button (Rect ((Screen.width/2)-350,(Screen.height/2)-50,80,20), "Graphic Settings")) {
AudioOn();}
if(audiochanger){
GUILayout.Label("AudioVolume");
Horizslidervalue = GUI.HorizontalSlider (Rect (25,25,100,30), Horizslidervalue,0.0,10.0);}
}
function QualityOn (){
audiochanger = false;
chooseQuality = true;
}
function AudioOn (){
audiochanger = true;
chooseQuality = false;
}
Someone please answer, i am tired of trying to think myself :(
Answer by BiG · Dec 23, 2011 at 04:13 PM
Search for this string in your code:
QualitySettings.currentLeve = QualityLevel.Simple;
Anything strange? Yes, you've forgotten a "l", and it must be
QualitySettings.currentLeve*l* = QualityLevel.Simple;
It didnt work, the same error is there even if i add the "l"
Answer by sketchers1 · Dec 23, 2011 at 04:38 PM
var buttonColor : Color = Color.blue;
var BackgroundColor : Color = Color.blue;
var Horizslidervalue : float = 0.0;
function OnGUI (){
GUI.contentColor = buttonColor;
GUI.backgroundColor = BackgroundColor;
if(GUI.Button (Rect ((Screen.width/2)-350,(Screen.height/2)-50,80,20), "Graphic Settings")) {
QualityOn();}
if(chooseQuality){
GUI.Label(Rect ((Screen.width/2)-200,(Screen.height/2) - 100,100,40), "Quality Settings");
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-50,80,20), "SuperLow");{
QualitySettings.currentLevel = QualityLevel.Fastest;
chooseQuality = false;}
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-100,80,20), "Low");{
QualitySettings.currentLeve = QualityLevel.Simple; chooseQuality = false;}
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-150,80,20), "Medium");{
QualitySettings.currentLevel = QualityLevel.Good;
chooseQuality = false;}
GUI.Button (Rect ((Screen.width/2)-400,(Screen.height/2)-200,80,20), "High");{
QualitySettings.currentLevel = QualityLevel.Fantastic;
chooseQuality = false;}
if(GUI.Button (Rect ((Screen.width/2)-350,(Screen.height/2)-50,80,20), "Graphic Settings")) {
AudioOn();}
if(audiochanger){
GUILayout.Label("AudioVolume");
Horizslidervalue = GUI.HorizontalSlider (Rect (25,25,100,30), Horizslidervalue,0.0,10.0);}
}
function QualityOn (){
audiochanger = false;
chooseQuality = true;
}
function AudioOn (){
audiochanger = true;
chooseQuality = false;
}
thats also the only mistake i found. i made it bold so you can find it. just add the l and you should be ready to roll! :)
It didnt work, the same error is there even if i add the "l"
The same :
Assets/scripts/$$anonymous$$yGraphics($$anonymous$$y$$anonymous$$enuCNT).js(25,30):BCE0044: expecting :, found '='
Your answer
Follow this Question
Related Questions
Main Menu Script Issues 1 Answer
Creating Fps Game Menu 2 Answers
FPS weapon sway script error 0 Answers
Error... that I don't understand. 3 Answers
GUI Scale Problem 1 Answer