how to add collider field in custom inspector

Hi, i was wondering how to add a field in custom inspector to show a variable that stores a reference to a collider. for instance if I wanted to show a float variable I would write

EditorGUILayout.FloatField("field name", the variable I want to show);

so what I’m wondering is how to do something like this with a collider field instead of float.
here’s a picture:

201983-none.jpg

You can use EditorGUILayout.ObjectField for this.

For example, this code:

my_collider = (Collider)EditorGUILayout.ObjectField("My collider!", my_collider, typeof(Collider), true);

produces this in the inspector:
201990-col.png

Hope this helps!

sorry i did not know i was posting duplicates it was telling my that my question can’t be posted because it has errors. so sorry i did not know it had been posting it over and over again :frowning: