NullRef exception when dragging imported fbx model into scene

Hi there,

I'm not sure exactly what's broken here, but in my pre-existing project (now opened up in 2018.3) every time I try to drag an imported fbx model from the project window into the scene (my intent is to start the process of creating prefabs), I'm getting just tons of null ref exceptions thrown.

The cursor also turns into the "nope" symbol (circle with diagnal line through it).

Also of interest is that prefabs I had previously created from the model all broke (the mesh and textures seem to be gone).

Any idea what's going on here and if it's fixable?

Null Ref Stack Trace

[spoiler]

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.GameObjectInspector.OnSceneDrag (UnityEditor.SceneView sceneView) (at C:/buildslave/unity/build/Editor/Mono/Inspector/GameObjectInspector.cs:816)
UnityEditor.SceneView.CallEditorDragFunctions () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2510)
UnityEditor.SceneView.HandleDragging () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2525)
UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1952)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[ ] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[ ] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:335)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)

[/spoiler]

Yup, same for some (not all) .blend files. Unity actually rewrites the file somehow, looking at the file in the inspector shows it contains one mesh named ‘sphere’ after the bug manifests.

Reverting in version control fixes the mesh thankfully..

Got the same issue.
Reimport should help

The revert worked for me.

Seems like a pretty significant bug during the project upgrade process though. Hope it gets addressed.

Thanks for your reports!
We have a fix under review. It could land as early as b3.

You can follow the resolution process here:
https://issuetracker.unity3d.com/issues/nested-prefabs-pptr-cast-failed-when-dereferencing-casting-from-prefabinstance-to-prefab-after-upgrading-corridor-scene

1 Like