- Home /
Can't drag and drop prefabs made by other people on my team (Git/Git LFS)
Me and two teammates are working on a project collaboratively - we are using Unity 5.x, git/git LFS for version control. All of us have a Windows machine and a Mac OSX machine, and have this problem regardless of who uses what machine:
1) Bob creates default geometry objects (cubes, cylinders, etc) or objects from imported packages (Prototyping, Vehicles, etc), putting a few of them into the scene, then groups them into a GameObject, names the GameObject "A", and drags it into the Project at Assets/Prefabs/ to create a prefab.
2) Bob closes unity, opens Git Shell (Windows) or Terminal (OSX). Bob is on branch
test
, and usesgit add /Assets/Prefabs/A.*
. Bob has Force Text and Visible Meta Files set up in Unity, so the meta file is committed. Bob already has git LFS set up to track both.prefab
and.prefab.meta
files.3) Bob uses
git push origin test
. and sees Git LFS upload the files.4) Alice clones the project, and switches to branch
test
. Git LFS pullsA.prefab
andA.prefab.meta
down when she changes to the branch.5) Alice opens Unity. If Bob tells Alice that A.prefab depends on any Standard Assets (Vehicles, Prototyping, etc), then she imports them in the editor.
6) Alice attempts to drag A into the scene from the Project. SOMETIMES this is successful - other times, the cursor turns into a circle-with-a-line-through, and Alice gets the following error in the console:
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:770) UnityEditor.SceneView.CallEditorDragFunctions () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1791) UnityEditor.SceneView.HandleDragging () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1804) UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1284) 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)
7) Attempting to refresh the object in Project produces this error:
Broken text PPtr in file(Assets/Prefabs/A.prefab). Local file identifier (1000012430532904) doesn't exist!
UnityEditor.GameObjectInspector:OnEnable()
We're tearing our hair out trying to figure this out. We cannot reliably reproduce this error - quite literally, some prefabs can't be added, and some can. We can't move forward with our project without being able to reliably share prefabs, so if anyone else has dealt with this and can help, we will be quite grateful!
UPDATE, SOLUTION: upgrading from Unity 5.3 to 5.4 seems to have solved the issue. ¯_(ツ)_/¯
Your answer
Follow this Question
Related Questions
How to fix /Library/ conflicts in GitHub repo for Unity project? 1 Answer
Unity Version Control - missing scene files and materials when downloading or cloning. 0 Answers
Git and Unity not working correctly: missing components, textures, materials, etc. 2 Answers
How to maintain an iOS and Android version of the same project? 1 Answer