Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

[SOLVED] All my scripts no longer load, even when i create new ones.

Discussion in 'Editor & General Support' started by Owningle, Jun 14, 2018.

  1. Owningle

    Owningle

    Joined:
    Jul 22, 2017
    Posts:
    3
    Hello, unity didnt reload and show a public variable that i had added, so i decided to restart unityto try and get it to refresh so i could access it in the inspector. After unity booted back up, all of my scripts have a warning that states 'The associated script can not be loaded'. When i try to add the scripts to other objects i am told that the file name does not match the class name, even though they 100% do.

    i have even tried creating a new project and importing my scripts into that project, same error occurs.

    i have also tried uninstalling and re installing unity, still no luck.

    Any help is appreciated, really dont want to loose all of my work.
     
  2. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Things to try:

    * Run Unity as Administrator
    * Create your projects under C:\Users\[username]\documents
    * Try deleting the Library folder, and re-open the project
    * Reinstall Visual Studio
    * Try with a new project and new scripts
     
  3. Owningle

    Owningle

    Joined:
    Jul 22, 2017
    Posts:
    3

    Thanks for your reply, i tried running as administrator, no luck.
    My project is under that directory, and still not working :/
    Deleted the Libary folder,
    reinstalled visual studio, nothing seemed to work.

    The one thing that did work is creating new scripts in a new project.

    I am using UNET in my current project, and it throws some errors when unity boots, along with a few other errors which are caused because the scripts are not loaded.

    Error:

    Failure generating network code.
    UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)

    Error due to lack of scripts loading:

    UNetWeaver error: SyncVar Hook function onChangeHealth not found for Health
    UnityEngine.Debug:LogError(Object)
    Unity.UNetWeaver.Log:Error(String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:20)
    Unity.UNetWeaver.NetworkBehaviourProcessor:CheckForHookFunction(FieldDefinition, MethodDefinition&) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:722)
    Unity.UNetWeaver.NetworkBehaviourProcessor:processSyncVarSet(FieldDefinition, String, Int32, FieldDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:2004)
    Unity.UNetWeaver.NetworkBehaviourProcessor:processSyncVar(FieldDefinition, Int32) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:2080)
    Unity.UNetWeaver.NetworkBehaviourProcessor:processSyncVars() (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:2237)
    Unity.UNetWeaver.NetworkBehaviourProcessor:process() (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetBehaviourProcessor.cs:55)
    Unity.UNetWeaver.Weaver:processNetworkBehaviourType(TypeDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1142)
    Unity.UNetWeaver.Weaver:CheckNetworkBehaviour(TypeDefinition) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1681)
    Unity.UNetWeaver.Weaver:Weave(String, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1791)
    Unity.UNetWeaver.Weaver:WeaveAssemblies(IEnumerable`1, IEnumerable`1, IAssemblyResolver, String, String, String) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/UNetWeaver.cs:1888)
    Unity.UNetWeaver.Program:process(String, String, String, String[], String[], IAssemblyResolver, Action`1, Action`1) (at C:/buildslave/unity/build/Extensions/Networking/Weaver/Program.cs:34)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface:TickCompilationPipeline(EditorScriptCompilationOptions, BuildTargetGroup, BuildTarget)


    (sorry for long post)
     
  4. Owningle

    Owningle

    Joined:
    Jul 22, 2017
    Posts:
    3
    Okay, i managed to get it working again, it my function onChangeHealth had an int as an argumanet even though the value being submitted was a float, and so it gave me this error, even though the error doesnt exactly tell me this, and no errors were seen inside of visual basic, but its solved :)