- Home /
How can I get a list of specific game objects in the object picker opened from an ObjectField()?
Hi all,
I have a tiny problem with the object picker. If I specify in the `ObjectField()` function the type of one of my scripts (not base types like Texture2D or Font), the object picker — the window which lets us select an asset from the scene or the assets folder — does not return the list of my assets which have the script on them.
The object picker does return only geometry prefabs (plane, cylinder, cube, Arial...). I have found a workaround that makes filtering on the whole GameObject type and make a check to know if there is a component on it, but it would be more convenient to have the list of a specified object type from the assets folder.
For the sake of completeness, if I set the `allowSceneObjects` to `true` in the `ObjectField()` function, the filter works correctly: it lets the object picker display only game object which contains the specified script type.
Also, is it normal that my markup wasn't taken into account in my question?
Your answer
![](https://koobas.hobune.stream/wayback/20220613083903im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
EditorGuiLayout - Objectfield 1 Answer
EditorGUILayout.ObjectField cannot be changed. 1 Answer
why I Cant Add Multiple Objects to the "Object Field" in Editor Window? 3 Answers
EditorGUILayout.ObjectField does not allow me to select a script. 1 Answer
How can I get the full path to an object in an ObjectField? 3 Answers