- Home /
Compiler errors
I started a new project and wrote this script:
function Update() { if(Input.GetButtonDown("Jump")) { transform.position.z += 1.0; } }
I fixed all the errors in the rest of the code and tested building everything in MonoDevelop. There wasn't any problem. But when I try to add that script to my main camera or test the game outside of MD, It tells me I have to fix all compilation errors and gives me this message in the console:
Internal compiler error. See the console log for more information. output was:Assets/Standard Assets/Scripts/General Scripts/ActivateTrigger.cs(43,58): warning CS0618: UnityEngine.GameObject.active' is obsolete:
GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.' Assets/Standard Assets/Scripts/General Scripts/ActivateTrigger.cs(53,58): warning CS0618: UnityEngine.GameObject.active' is obsolete:
GameObject.active is obsolete. Use GameObject.SetActive(), GameObject.activeSelf or GameObject.activeInHierarchy.' Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(27,74): warning CS0618: UnityEngine.Mesh.GetTriangleStrip(int)' is obsolete:
Use GetTriangles instead. Internally this function converts a list of triangles to a strip, so it might be slow, it might be a mess.' Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(130,73): warning CS0618: UnityEngine.Mesh.GetTriangleStrip(int)' is obsolete:
Use GetTriangles instead. Internally this function converts a list of triangles to a strip, so it might be slow, it might be a mess.' Assets/Standard Assets/Scripts/Utility Scripts/MeshCombineUtility.cs(177,30): warning CS0618: UnityEngine.Mesh.SetTriangleStrip(int[], int)' is obsolete:
Use SetTriangles instead. Internally this function will convert the triangle strip to a list of triangles anyway.'
Unhandled Exception: System.UnauthorizedAccessException: Access to the path "C:\Users\Shiloh\Documents\Spiria\Temp\Assembly-CSharp-firstpass.dll.mdb" is denied.
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean anonymous, FileOptions options) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, Boolean isAsync, Boolean anonymous) [0x00000] in :0
at System.IO.FileStream..ctor (System.String path, FileMode mode, FileAccess access) [0x00000] in :0
at Mono.CompilerServices.SymbolWriter.MonoSymbolWriter.WriteSymbolFile (Guid guid) [0x00000] in :0
at Mono.CSharp.SymbolWriter+SymbolWriterImpl.WriteSymbolFile () [0x00000] in :0
at Mono.CSharp.SymbolWriter.WriteSymbolFile () [0x00000] in :0
at Mono.CSharp.CodeGen.Save (System.String name, Boolean saveDebugInfo, Mono.CSharp.Report Report) [0x00000] in :0
at Mono.CSharp.Driver.Compile () [0x00000] in :0
at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in :0
What do I do?
Do you have any files in the project that are completely blank? If you clear the Console window, are there any error messages?
Get rid of the standard assets, for starters. You should generally only import them when you need them (there's no reason to have them lying around unused, especially if they seem to be causing errors).
It looks as though you may be trying to use "UnityEngine.GameObject.active" which is obsolete (this should only cause a warning however and wouldnt cause your game to stop). As to your other errors I would try clicking 'Refresh' and 'Sync $$anonymous$$onoDevelop Project' from the 'Assets' menu. I think something is getting borked between Unity and $$anonymous$$onoDevelop .
warning CS0618: UnityEngine.ParticleCollisionEvent.collider' is obsolete:
collider property is deprecated. Use colliderComponent ins$$anonymous$$d, which supports Collider and Collider2D components.'
Answer by MrPhil · Jul 10, 2014 at 02:50 AM
What you've pasted is a list of warnings an errors. Your problem is the Unhandled Exception. This "Access to the path" error usually means the file is read-only, but the compiler is trying to replace it with a new version. Is your source control locking the file?
It is safe to ignore the "is obsolete" warnings, that won't keep the game from playing correctly.
Your answer
Follow this Question
Related Questions
can't add script, Unity says class name doesn't match 6 Answers
Compiler errors when opening unity 0 Answers
All scripts come up with compiler errors 3 Answers
How to make a 3d model plane fly? 3 Answers
GameObject Spawning 2 Answers