Unity will no longer build my game

So, I’ve been developing this game for a friend, who owns a Mac, so I build my unfinished project so I can show her what I’ve made so far, which finishes without a problem. But then, I try to make a build of the same game for Windows, which is what my system is. I have done this plenty of times before, but this time, in the middle of building, it gave me an error and I had to Force Quit. Now when I load up my scene, I can still test the game in the editor, as it gives me no compiler errors, but whenever I try to make a build for Windows, it gets stuck on “Compiling Scripts” for a few seconds, and aborts with a “ding” noise. If I check my console window, it gives me the following errors:

Red Errors

  1. Assets/CubemapMaker/Source/CubemapMaker.js(59,17): BCE0005: Unknown identifier: ‘Asset Database’.
  2. Error building player because scripts had compiler errors
    UnityEditor.HostView:OnGUI()
  3. Exception: Error building player because scripts had compiler errors
    UnityEditor.BuildPlayerWindow.BuildPlayerWithDefaultSettings (Boolean askForBuildLocation, BuildOptions forceOptions)(at C:/BuildAgent/work/842f9557127e852/Editor/Mono/BuildPlayerWindow.cs:367

Yellow Errors

  1. Assets/CharacterControllerScripts/AccellerationCharacterController.cs(6,17): warning CS0436: The type ‘CharacterMotor’ conflicts with the imported type ‘CharacterMotor’. Ignoring the imported type definition
  2. Assets/CharacterControllerScripts/AccellerationCharacterController.cs(6,17): warning CS0436: The type ‘CharacterMotor’ conflicts with the imported type ‘CharacterMotor’. Ignoring the imported type definition

Yes, it gave me one of the same errors twice.

How do I fix this? I have tried Uninstalling Unity, clearing the registry of any Unity Editor files, and reinstalling. I have also used the “Reimport all assets” feature in Unity to no avail. Is there any way I can solve this problem?

Your CubemapMaker script uses the UnityEditor namespace which is not available at runtime. I guess the script is an editor script so you have to place it in a folder called “Editor”.

Your “Yellow Errors” are not errors they are warnings. It seems the AccellerationCharacterController script defines a type called CharacterMotor but that’s a class that already exists in the Standard Assets. You should do some cleanup in your project and remove things you don’t use / need.