why I Cant Add Multiple Objects to the "Object Field" in Editor Window?

I have an Object field in my editor window. I can add single objects from hierarchy. However I cannot do the same when I select multiple objects and drag&drop them into the object field. Isnt it possible, or is there any other way?

If you want to assign multiple objects to a field, this field needs to be an array, like Object[] or GameObject[]

@veddycent @simsis3d

What you want is not possible but you can do this however. You can detect when the user has dropped the items into the field and then you can use this field to get what objects were selected at the time of the drop:


A snippet from what I used:

GameObject tempObject;
tempObject = (GameObject)EditorGUILayout.ObjectField(tempObject, typeof(GameObject), true);

    if (tempObject != null)
        if (Selection.gameObjects.Length > 1)
             // Do multiple stuff here

ObjectField does not have a variant that targets and array of UnityEngine.Object.
This answer will accomplish what you are looking to do: