EditorGUILayout.ObjectField redundant space between label and object field?

This pretty much says it all:

21545-fsm.png

Look at all that redundant space between the label and the field. It looks so stupid. How to get rid of it? How to make it more compact?

Code:

public override void OnInspectorGUI()
{
	var use = target as SingleItemUse;

	GUILayout.Label("Item entry", EditorStyles.boldLabel);
	GUIHelper.HorizontalBlock(() =>
	{
		use.entry.placement = EditorGUILayout.ObjectField("Placement", use.entry.placement, typeof(Transform), false) as Transform;
		use.entry.item = EditorGUILayout.ObjectField("Item", use.entry.item, typeof(Item), false) as Item;
	});
}

Thanks for any help.

Hi vexe :slight_smile:

You can use EditorGUIUtility.labelWidth to control the space reserved for label. Changing it before calling each EditorGUILayout.ObjectField allows to set different widths for different labels.