EditorGUILayout.ObjectField only showing the objects in my Assets folder

My problem is that the EditorGUILayout.ObjectField function opens a window that is missing the “Scene” tab. I can’t search for objects in my hierarchy with an ObjectField.

I’m putting my code in an OnInspectorGUI() function.

public static Transform arrow;

public override void OnInspectorGUI ()
{
		EditorGUILayout.BeginHorizontal();
		arrow = (Transform)EditorGUILayout.ObjectField("Arrow ",arrow , typeof(Transform));
		EditorGUILayout.EndHorizontal();
}

Maybe you need to use EditorGUILayout.PropertyField() along with a SerializedProperty? What are you trying to achieve? (I.e. what do you need different than what the default inspector does?)

I just wanted to completely hide the inspector properties and use the custom editor I coded. I guess I could use the default inspector to do what I want. I’d like to know if the behaviour of EditorGUILayout.ObjectField is normal by not displaying the “Scene” tab, maybe there’s a bug.

bump, any solutions to this?

We have the same problem. It used to work just fine in Unity 2.6… now that we’ve ported our code it’s only possible to select assets and not objects from the scene.

This bug has been reported (case number 374917) and is currently under investigation.

Going to bump, I would love to select the game objects from my scene, and not just project.