EditorGui ObjectField

I try to get so that I can from a custom editor drag scripts (classes) in and store it in an array/list. The classes I try to add is all derived from a class called Race which is in it’s turn derived from ScriptableObject.

EditorGUILayout.ObjectField("New Race", null, typeof(ScriptableObject), false);

I have tried with both typeOf(SciptableObject) and typeOf(Race) but none of them let me drag any scripts in.

That should work, the only issue might be that you’re not setting the value to the newly selected one.

Try doing:

property.value = EditorGUILayout.ObjectField("New Race", null, typeof(ScriptableObject), false);

If that doesn’t work then it must be because you have the last property set to false which is “allowSceneObjects”, try setting that to true.