I followed this part of the 3D platformer tutorial step by step for 1 hour(or more), and was sad when i got this many errors
script:
//Make the script also execute in edit mode @script ExecuteInEditMode()
var gskin : GUISkin; var backdrop : Texture2D; //Our backdrop image goes here private var isLoading = false; //if true, we'll display the "Loading..." message
function OnGUI() { if(gSkin) GUI.skin - gSkin; else Debug.Log("StartMenuGUI: GUI Skin object missing!")
var backgroundStyle : GUIStyle = new GUIStyle();
backgroundStyle.normal.background = backdrop;
GUI.Label ( Rect( (Screen.width - (Screen.height * 2)) * 0.75, 0 Screen.height * 2,
Screen.height), "", backgroundStyle);
GUI.Label ( Rect( (Screen.width/2)-197, 50, 400, 100), "Lerpz Escapes", "mainMenuTitle");
if(GUI.Button( Rect( (Screen.width/2)-70, Screen.height - 160, 140, 70), "Play")) {
isLoading = true;
Application.LoadLevel("TheGame");
//load the game level.
}
var isWebPlayer = (Application.platform = RuntimePlatform.OSXWebPlayer || Application.platform == RuntimePlatform.WindowsWebPlayer);
if(!isWebPlayer) {
if (GUI.Button( Rect( (Screen.width/2)-70, Screen.height - 80, 140, 70), "Quit"))
Application.Quit();
}
if(isLoading)
GUI.Label (Rect( (Screen.width/2)-110, (Screen.height / 2) - 60, 400, 70),
"Loading", "mainMenuTitle");
}
errors:
Assets/StartMenuGui.js(13,61): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/StartMenuGui.js(17,75): BCE0044: expecting ), found 'Screen'.
Assets/StartMenuGui.js(17,81): BCE0044: expecting ), found '.'.
Assets/StartMenuGui.js(17,82): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/StartMenuGui.js(17,92): BCE0043: Unexpected token: ,.
Assets/StartMenuGui.js(17,93): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/StartMenuGui.js(18,14): BCE0043: Unexpected token: ).
Assets/StartMenuGui.js(18,19): BCE0043: Unexpected token: ,.
Assets/StartMenuGui.js(18,21): BCE0043: Unexpected token: backgroundStyle.
Assets/StartMenuGui.js(29,41): BCE0044: expecting ), found '='.
Assets/StartMenuGui.js(29,42): UCE0001: ';' expected. Insert a semicolon at the end.
Assets/StartMenuGui.js(30,67): BCE0043: Unexpected token: ).
Please help this is my first script ever and im trying my best to learn, and i shall never give up.