Search Unity

The associated script cannot be loaded, please fix errors...

Discussion in 'Getting Started' started by Pollawat, Jun 21, 2018.

  1. Pollawat

    Pollawat

    Joined:
    Aug 27, 2016
    Posts:
    192
    The associated script cannot be loaded, please fix errors...

    I know that because I been there before, but this time it doesn't show me what script is the problem.



    As you can see in console panel, Please help. How can I fix the error script inside of the asset?

    Edit, I try to delete a file one by one and even I delete all of them the problem still occurs so I assume this might because of Unity itself so I'm reinstalling.

    I got: Thread group size must be above zero UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
    Last edited: Jun 21, 2018
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,741
    It says the script is missing actually. Which either means it cannot be loaded because it didn't compile, or it's really missing.
     
  3. Pollawat

    Pollawat

    Joined:
    Aug 27, 2016
    Posts:
    192
    Thank you for your answer, anyway it happens with every single object in the scene. This is normal when I recreate entire library file so far, but this time I can't find the source. Last time I just need to delete one of them somewhere and the entire scene was fixed. Another time was I forgot to write ";" in the motor script, I know where it wrong because the console panel told me but this time is different.

    ps. Sorry if my English annoying you, I'm not good at it.
     
    Last edited: Jun 21, 2018
    eric0521 likes this.
  4. verybinary

    verybinary

    Joined:
    Sep 23, 2015
    Posts:
    373
    it looks like the script was deleted. putting the script back wouldn't help, as the script reference is still null. right click that component, and remove it. if you know what the script was supposed to do, add it back in, and then add it back to the object. yes every single object in the scene, or go back to a backup where the script wasn't deleted.
     
  5. Pollawat

    Pollawat

    Joined:
    Aug 27, 2016
    Posts:
    192
    Fixed, Thank you, everyone.



    I reinstalled the Unity and everything fixed now, I don't know why, I don't know how, but the thing that I notice is Unity can't even pop up the standard component for a game object, so I thought something went wrong and I reinstalled it.

    - Everything fixed because I create a new project but still, same error happens. So I clean deleted the program and reinstall it.
     
  6. amdbuster

    amdbuster

    Joined:
    Nov 6, 2018
    Posts:
    8
    I have the same problem (The associated script cannot be loaded, please fix any compile errors and assign a valid script).
    I make C# Tuts since Weeks(Each Tut has a single Script), the last Yesterday, and all woks fine. But Today all Scripts have this error.

    Reimport and reinstall doenst work.
    Why and where ist the problem?
     
  7. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    @amdbuster You have to look at the specific errors the compiler is giving you. It's telling you which script has the issue, and what lines the errors are occurring at, and even why it's failing. Share that information with us and we can direct you further.
     
  8. amdbuster

    amdbuster

    Joined:
    Nov 6, 2018
    Posts:
    8
    I have this error in all Projects:
     
  9. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    Well besides the two syntax errors the console is pointing out to you (refer to lines 16 and 31 of those scripts), it looks like you may have some invalid characters in the script names. Try simplifying them a good bit and see if that fixes anything.
     
  10. amdbuster

    amdbuster

    Joined:
    Nov 6, 2018
    Posts:
    8
    But why all these Scripts works before?

    If i aktivate either Script, Unity say:
    Generating diff of this object for undo because the type tree changed.
    This happens if you have used Undo.RecordObject when changing the script property.
    Please use Undo.RegisterCompleteObjectUndo

    Not one have this..
     
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,147
    Like it says, the associated script cannot be loaded because there is a bug in one of your scripts. One compile time error is all it takes for a programming language compiler to be unable to work with your entire codebase. Fix the red errors listed in the console and the compiler will once again be able to compile all of your scripts.
     
  12. amdbuster

    amdbuster

    Joined:
    Nov 6, 2018
    Posts:
    8
    I dont know why, but the errors are gone. o_O
     
  13. meerys

    meerys

    Joined:
    Sep 6, 2018
    Posts:
    1
    I have the same probleem !! sometimes I open unity and it works, and sometimes I get this error. How can i fix it? the new unity update gives me many errors
     
  14. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Depends on the specific error, which you haven't mentioned. Generally the process is you look at the first error, fix that problem in your code, save, and go back to Unity so it recompiles your code and see if there are any further errors.
     
  15. septN

    septN

    Joined:
    Oct 29, 2015
    Posts:
    53
    Just had this problem with my project that I cloned on another PC. My RuleTile that I had created with Unity 2D Extras wasn't working.

    So I just create a "New Isometric Rule Tile.asset", and fix the old script guid of my broken RuleTile

     
    Fibonaccov likes this.
  16. SCPCoder

    SCPCoder

    Joined:
    Jul 18, 2022
    Posts:
    1
    Tuve este problema y asi como se me presento se fue, hice el codigo y lo puse en el objeto player pero me resulto en este error asi que vine a investigar y la manera en la que se soluciona es algo sensillo pero no a la vez, para solucionarlo debes guardar el codigo en tu compilador, en la seccion "guardar como:" y se soluciona , a mi me funciono en el compilador visual studio espero haberte ayudado uwu
     
  17. unity_CD21894F6BF4210A9493

    unity_CD21894F6BF4210A9493

    Joined:
    Aug 7, 2022
    Posts:
    6
    ok so i am having with this error but none for the ansers fix it