I didn’t get far before falling over! lol!
Ok, I’m doing the Lerpz tutorial and am at the stage of creating the main menu. I’ve created my first script file (StartMenuGUI) but get a few error messages. I’ve checked my code a million times but cannot see any ( ; ) problems? any help?
=================== script ====================
// Make the script also execute in edit mode
@script ExecuteInEditMode()
var gSkin : GUISkin;
var backdrop : Texture2D;
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");
}
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" );
}
============== error codes =====================
Initialize mono
Direct3D:
Version: Direct3D 9.0c [atiumdag.dll 8.14.10.685]
Renderer: ATI Radeon HD 4800 Series
Vendor: ATI
VRAM: 512 MB
LicenseInfo:InitializeProtection
open PACE from our own executable
opened PACE, get info…
checked authorization, authstate=100 r=0
ReadDeveloperData
ReadTokens
Forcing trial flag
C:/Users/Public/Documents/Unity Projects/3DPlatformerTutorialStart
Mono: successfully reloaded assembly
Updating assets - GUID: 00000000000000001000000000000000…
done: hash - b3795fd68ab4f27992613b8acfafba21
Updating library/editorbuildsettings.asset - GUID: 0000000000000000b000000000000000…
done: hash - d03ef7c4fe709c9586f33d65014b3f03
Updating library/networkmanager.asset - GUID: 0000000000000000a000000000000000…
done: hash - 6d8cbd47ad5a9022a015765b686c1053
Updating library/buildplayer.prefs - GUID: 00000000000000005000000000000000…
done: hash - 03f71213fbc619fdf2c5bfbbd1780f60
Updating library/projectsettings.asset - GUID: 00000000000000004000000000000000…
done: hash - 04b52471b36ed7298a6518bba804cf3b
Updating library/qualitysettings.asset - GUID: 00000000000000009000000000000000…
done: hash - ea5ccef6d60594380a78c9e34a02eeb8
Updating library/tagmanager.asset - GUID: 00000000000000003000000000000000…
done: hash - 1c7f19929f732709059d5f02e349453a
Updating library/editorsettings.asset - GUID: 0000000000000000c000000000000000…
done: hash - be195a9d98d55caa8f41b0fdfb0bbec5
Updating library/dynamicsmanager.asset - GUID: 00000000000000008000000000000000…
done: hash - 0a202696f9c21bf69324c8212f612d15
Updating library/audiomanager.asset - GUID: 00000000000000006000000000000000…
done: hash - 9fb9c957e6a1da942770963c32de23b1
Updating library/inputmanager.asset - GUID: 00000000000000002000000000000000…
done: hash - f49bcd0a7aabbee02776e8c02f1a9975
Updating library/timemanager.asset - GUID: 00000000000000007000000000000000…
done: hash - 1456d9aea04a8533d696f7a7b233b9c6
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUISkin.BuildStyleCache ()
UnityEngine.GUISkin.OnValidate ()
UnityEngine.ScriptableObject:.ctor()
UnityEngine.ScriptableObject:.ctor()
UnityEngine.GUISkin:.ctor()
GUISkinEditor:CreateNewGUISkin()
(Filename: Line: -1)
Updating assets/new guiskin.guiskin - GUID: 90cd6f8cc8512864d8585f906ec953a9…
done: hash - f4595d05676a8f0f13a89ea30b72bece
Updating assets/scenes/thegame4.unity - GUID: 48307271de33a6a4a982aceffa570b4c…
done: hash - 6019838fcf70acd87e559957646dfe54
Mono: successfully reloaded assembly
Reload assembly time: 0.333491
Mono: successfully reloaded assembly
Reload assembly time: 0.340466
Updating assets/startmenu.unity - GUID: a74d347cf1bd6f64bb478f5cd6d1f618…
done: hash - 44207946eba9aa3db0d1d572c0dfc600
Updating assets/newbehaviourscript.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 7fd027a619614aff17fd80e5ba55284f - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Calculating changed assemblies
End Calculating changed assemblies
Mono: successfully reloaded assembly
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
done: hash - 7fd027a619614aff17fd80e5ba55284f
Calculating changed assemblies
End Calculating changed assemblies
Calculating changed assemblies
End Calculating changed assemblies - starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
- Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Calculating changed assemblies
End Calculating changed assemblies
Mono: successfully reloaded assembly
Updating library/networkmanager.asset - GUID: 0000000000000000a000000000000000…
done: hash - 6d8cbd47ad5a9022a015765b686c1053
Updating library/projectsettings.asset - GUID: 00000000000000004000000000000000…
done: hash - 04b52471b36ed7298a6518bba804cf3b
Updating library/qualitysettings.asset - GUID: 00000000000000009000000000000000…
done: hash - ea5ccef6d60594380a78c9e34a02eeb8
Updating library/tagmanager.asset - GUID: 00000000000000003000000000000000…
done: hash - 1c7f19929f732709059d5f02e349453a
Updating library/dynamicsmanager.asset - GUID: 00000000000000008000000000000000…
done: hash - 0a202696f9c21bf69324c8212f612d15
Updating library/audiomanager.asset - GUID: 00000000000000006000000000000000…
done: hash - 9fb9c957e6a1da942770963c32de23b1
Updating library/inputmanager.asset - GUID: 00000000000000002000000000000000…
done: hash - f49bcd0a7aabbee02776e8c02f1a9975
Updating library/timemanager.asset - GUID: 00000000000000007000000000000000…
done: hash - 1456d9aea04a8533d696f7a7b233b9c6
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies - starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 67480485c2fe223e7c5aa7a5871b7b61 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(17,13): BCE0019: ‘label’ is not a member of ‘UnityEngine.GUI’. Did you mean ‘Label’ ?
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(17,28): BCE0005: Unknown identifier: ‘screen’.
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(17,44): BCE0005: Unknown identifier: ‘screen’.
(Filename: Assets/StartMenuGUI.js Line: 17)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - f0e04d6f2cb8391906b59b93bc0455bd - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(17,13): BCE0019: ‘label’ is not a member of ‘UnityEngine.GUI’. Did you mean ‘Label’ ?
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(17,28): BCE0005: Unknown identifier: ‘screen’.
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(17,44): BCE0005: Unknown identifier: ‘screen’.
(Filename: Assets/StartMenuGUI.js Line: 17)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 61af38ab87074a0942d50de9c2a3c72e - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(17,13): BCE0019: ‘label’ is not a member of ‘UnityEngine.GUI’. Did you mean ‘Label’ ?
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(17,28): BCE0005: Unknown identifier: ‘screen’.
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(17,44): BCE0005: Unknown identifier: ‘screen’.
(Filename: Assets/StartMenuGUI.js Line: 17)
Assets/StartMenuGUI.js(22,29): BCE0005: Unknown identifier: ‘True’.
(Filename: Assets/StartMenuGUI.js Line: 22)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - eef44448b187d725554b0d4d113788e2 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(29,96): BCE0043: Unexpected token: ).
(Filename: Assets/StartMenuGUI.js Line: 29)
Assets/StartMenuGUI.js(33,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 38a2be8e6dad33ae83f1d085573fd0e3 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(29,96): BCE0043: Unexpected token: ).
(Filename: Assets/StartMenuGUI.js Line: 29)
Assets/StartMenuGUI.js(33,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - a9066c99ca786a2394e0f857d32605f2 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(29,96): BCE0043: Unexpected token: ).
(Filename: Assets/StartMenuGUI.js Line: 29)
Assets/StartMenuGUI.js(33,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 7b54cb3b40477e786ba1cb180ea98f89 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,96): BCE0043: Unexpected token: ).
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(34,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 34)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - ab58b0158e6cad0dd1945008738f3d5a - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,98): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(34,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 34)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 7f1e43b87b2d92b3a79e9208acbca654 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,98): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(34,23): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 34)
Updating assets/startmenu.unity - GUID: a74d347cf1bd6f64bb478f5cd6d1f618…
done: hash - 5484bae49e3603d8291307027b704120
Updating library/dynamicsmanager.asset - GUID: 00000000000000008000000000000000…
done: hash - 0a202696f9c21bf69324c8212f612d15
Updating assets/scenes/startmenu.unity - GUID: a74d347cf1bd6f64bb478f5cd6d1f618…
done: hash - 5484bae49e3603d8291307027b704120
Updating library/dynamicsmanager.asset - GUID: 00000000000000008000000000000000…
done: hash - 0a202696f9c21bf69324c8212f612d15
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 6855e2d858a96dd8157d6a1bfa12b9d3 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,99): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(34,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 34)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - c0df8d80abaef8860637fe08b98bdd20 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,99): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(33,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 79203bc79be2d1ce24dbd95782b99ae9 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,99): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(33,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 1c30b9d88e57a3a36d5292b840c3e582 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,99): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(33,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 6431ba5f4b6371b0a62ad2387aa02bc1 - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,99): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(33,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
Updating assets/startmenugui.js - GUID: 2a212f7080227424295000ba7f99261c…
Calculating changed assemblies
End Calculating changed assemblies
- starting compile Library/ScriptAssemblies/Assembly - UnityScript.dll
done: hash - 3dc107bf604cd873a62f5ebdba358b1f - Finished compile Library/ScriptAssemblies/Assembly - UnityScript.dll
Assets/StartMenuGUI.js(30,99): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 30)
Assets/StartMenuGUI.js(33,24): UCE0001: ‘;’ expected. Insert a semicolon at the end.
(Filename: Assets/StartMenuGUI.js Line: 33)
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.EndLayoutGroup ()
UnityEngine.GUILayout.EndHorizontal ()
UnityEditor.ConsoleWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) [0x00000]
(Filename: Line: -1)
==============================================