Question by
Doomlaser · Mar 21, 2018 at 07:58 AM ·
errorerror messageprefabsprefab-instance
Internal Unity Error when trying to save a Prefab.
This happens every time I try to save the Prefab:
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.PrefabUtility.RegisterNewObjects (System.Collections.Generic.List`1 newHierarchy, System.Collections.Generic.List`1 hierarchy, System.String actionName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/ImportSettings/PrefabUtility.cs:121)
UnityEditor.PrefabUtility.ReplacePrefabWithUndo (UnityEngine.GameObject target) (at /Users/builduser/buildslave/unity/build/Editor/Mono/ImportSettings/PrefabUtility.cs:223)
UnityEditor.GameObjectInspector.DoPrefabButtons (PrefabType prefabType, UnityEngine.GameObject go) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:347)
UnityEditor.GameObjectInspector.DrawInspector () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:260)
UnityEditor.GameObjectInspector.OnHeaderGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:170)
UnityEditor.Editor.DrawHeader () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:420)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1117)
UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1022)
UnityEditor.InspectorWindow.OnGUI () (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:361)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295)
UnityEditor.HostView.Invoke (System.String methodName) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at /Users/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:255)
Even if I delete the Prefab file and try to make a new one, I get the same result. How the heck do I fix this? Unity version 2017.3.0f3
Comment
I'm getting the same error, not sure what's going on. Did you ever find a fix?
Answer by exzizt · Mar 21, 2018 at 08:31 AM
Just a guess, but is there something that runs in the Editor in your prefab? That could be causing the issue.
Your answer
![](https://koobas.hobune.stream/wayback/20220612155035im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
0xc000007b error on 64 bit machine? 1 Answer
Error, host set to 1 Answer
how to add duplicate prefabs to different limbs of 3d model 0 Answers