Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question The associated script cannot be loaded

Discussion in 'Scripting' started by syazsyahril, Jul 10, 2020.

  1. syazsyahril

    syazsyahril

    Joined:
    May 17, 2020
    Posts:
    9
    I use standard asset, I did not do anything yet just attach 2d character but it show this " the associated script cannot be loaded. please fix all compiler errors unity and assign a valid script"
    the import script has this error
     

    Attached Files:

  2. Elango

    Elango

    Joined:
    Jan 27, 2016
    Posts:
    107
    Is the .cs file name exactly the same as the class name in it?
     
  3. syazsyahril

    syazsyahril

    Joined:
    May 17, 2020
    Posts:
    9
    Oh wait it does show this( no monobehaviour scripts in the file or their names do not match the file name) for all the script
     
  4. syazsyahril

    syazsyahril

    Joined:
    May 17, 2020
    Posts:
    9
    I already fix and the file name is same but it still shown the same problem. All compiler error have to be fixed
     
  5. Elango

    Elango

    Joined:
    Jan 27, 2016
    Posts:
    107
  6. syazsyahril

    syazsyahril

    Joined:
    May 17, 2020
    Posts:
    9
  7. Elango

    Elango

    Joined:
    Jan 27, 2016
    Posts:
    107
    I didn't tested it myself so honestly don't know if it still works for lastest version. I'm not using any assets so can't recommend any...
    There's thread about it:
    https://forum.unity.com/threads/solved-standard-assets-gives-too-many-errors-in-new-versions.619018/
    Some errors can be fixed but but if you have no errors it's hard to guess. Maybe it has dependency on some packages that's not installed.
    As last resort you can try to delete Library folder from project (after this Unity starts with blank scene. Just open your saved scene again).