Search Unity

Error building Player because scripts have compile errors in the editor

Discussion in 'Editor & General Support' started by ev3d, Jun 1, 2017.

  1. ev3d

    ev3d

    Joined:
    Apr 19, 2013
    Posts:
    327
    I am getting this error:

    Error building Player because scripts have compile errors in the editor

    But there are NO OTHER errors...

    Screenshot 2017-05-31 at 06.39.29 PM.png

    If i try to play... i get...

    Screenshot 2017-05-31 at 06.40.41 PM.png

    Kinda hard to fix a compile error when there is none..
     
  2. larku

    larku

    Joined:
    Mar 14, 2013
    Posts:
    1,422
    Probably wont help, but try closing Unity, delete the Temp and Library folders, open Unity let it reimport assets/scripts and try again.
     
  3. ev3d

    ev3d

    Joined:
    Apr 19, 2013
    Posts:
    327
    looks like a bug in 5.6.1f1
     
  4. tsibiski

    tsibiski

    Joined:
    Jul 11, 2016
    Posts:
    604
    I've gotten this exception before. Turned out to be from using named arguments in my case. I just tried to reproduce it, but I have a much newer version of Unity now, and cannot.

    In the older versions, if I did:

    public static void SomeMethod() {
    SomeOtherMethod(SecondVariable: 2);
    }

    public static void SomeOhterMethod(int FirstVariable = 0; int SecondVariable = 0) {
    ///Etc.
    }

    This would cause the error you are seeing for me.