unity-game-engine

Unity built-in Packages Compiler Errors


I just started learning how to use Unity to make a simple 3D game. It's working fine when it comes to creating the environment, but once I imported the built-in Character package it gave me a compiler error and wouldn't run (All compiler errors have to be fixed before you can enter playmode!).
Removing the imported package removes the error and it can run, I tried using other built-in packages like 2D or Cameras but same problem occurred.

After adding 2D package, here's the console (error with no text): Compiler Error After adding a character from the package, here's what the Inspector says (the associated script cannot be loaded. please fix all compiler errors and assign a valid script): Script can not be loaded As shown in the pictures I'm using unity 5.6.0f3 64-bit. I tried uninstalling and re-downloading it again but that didn't work. I tried creating a new empty project, import a package and hit run, still didn't work.

code file


Solution

  • A working solution from this post.

    Hi, I reported this as a bug and I just got the response from Unity today. Try changing system locale to not Arabic. Go to Control Panel > Change date, time or number format> Administrative tab> Change system locale


    Check if the script file name is the same as the class name in the file? They should be the same.

    scripts

    UPDATE

    See this part of the picture.

    image

    No Monobehaviour scripts in the file, or the names do not match the file name.

    And from here,

    MonoBehaviours inside namespaces break, if they have a method with a default parameter (such as public void Foo(bool bar=true)).

    See also here.


    And it seems an identical issue of Compile Error with empty message.

    Solution from the post:

    Could get a Error message on another computer and it's the same as mentioned in this Thread: Creating managed DLL for Unity fails with error when importing into Unity

    Which lead to this: http://forum.unity3d.com/threads/5-2-1p3-mono-cecil-assemblyresolutionexception-unityengine-ui-dll.361666/

    I could actually solve it with manually deleting all remains of Unity and Monodevelop after the deinstallation (ex. C:\Users[YourUserName]\AppData\Local etc. ) and then reinstalling 5.2.3f.