Why are the children of my Serialized Property not being drawn?

Hi all

I’ve been trying to use SerializedObject and SerializedProperty to draw some ScriptableObjects in the inspector:

SerializedObject serializedKvp = new SerializedObject(kvp);
SerializedProperty valuesListProperty = serializedKvp.FindProperty("m_Value");
SerializedProperty modifierProperty = valuesListProperty.GetArrayElementAtIndex(index);
				
EditorGUILayout.PropertyField(modifierProperty, true);

What I’m getting is this:

alt text

Firstly, I don’t want the “Element 0” label, which I presume is Unity trying to be “helpful” because my property is a List index.

Secondly, I’m telling the PropertyField to draw the children and I’m not getting any. If I double click the PropertyField I get this in a new inspector:

alt text

So you can clearly see that the property has child properties.

Can anyone explain to me why this is happening and how I can improve it?

Thanks,
Ves

This was a fundamental misunderstanding of how ScriptableObjects work. Since ScriptableObjects are their own asset, Unity doesn’t bother recursing through them and instead draws an object field.