Search Unity

Stream of errors when adding a script component

Discussion in 'Getting Started' started by mv95, Oct 2, 2017.

  1. mv95

    mv95

    Joined:
    Sep 28, 2017
    Posts:
    3
    Hello all,

    I'm, having trouble getting started with Unity. I try to follow the Roll a ball tutorial, and follow the steps exactly. However, I found out that as soon as I create a script component, the following error starts appearing twice per second in the console:

    NullReferenceException: Object reference not set to an instance of an object

    Even removing the script component does not solve this problem, even if I save and restart Unity without it. Did something go wrong with the installation of Unity or am I just not seeing something?

    Thanks in advance
     
  2. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    You're not seeing the details. Try selecting one of those errors in the Console, Copying it (cmd-C or ctrl-C, depending on your platform), and Pasting it here. That should include the relevant details, and we might be able to help.
     
  3. mv95

    mv95

    Joined:
    Sep 28, 2017
    Posts:
    3
    When I copy the error it gives me the following:

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Scripting.Compilers.ScriptCompilerBase.CompilationHadFailure () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:155)
    UnityEditor.Scripting.Compilers.ScriptCompilerBase.DumpStreamOutputToLog () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:169)
    UnityEditor.Scripting.Compilers.ScriptCompilerBase.GetCompilerMessages () (at C:/buildslave/unity/build/Editor/Mono/Scripting/Compilers/ScriptCompilerBase.cs:148)
    UnityEditor.Scripting.ScriptCompilation.CompilationTask.Poll () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationTask.cs:102)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilation.TickCompilationPipeline (EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilation.cs:524)
    UnityEditor.Scripting.ScriptCompilation.EditorCompilationInterface.TickCompilationPipeline (EditorScriptCompilationOptions options, BuildTargetGroup platformGroup, BuildTarget platform) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/EditorCompilationInterface.cs:122)

    It's odd because I only have to create the script, I have not even typed anything in it yet or assigned it to the sphere..
     
  4. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,859
    Yeah, the trackback there seems to indicate a bug in Unity itself, not in your script.

    Are you using the latest release of Unity?

    I'd suggest contacting Unity Support about this. Be sure to include as much detail as you can, including the above traceback, and details on what platform you're running it on.
     
  5. mv95

    mv95

    Joined:
    Sep 28, 2017
    Posts:
    3
    I ended up re-installing Unity and the problem is solved now. Thanks for the support!
     
    JoeStrout likes this.
  6. bruce_

    bruce_

    Joined:
    Dec 19, 2016
    Posts:
    1
    re installing unity will solved this error