# ShowObjectPicker<T>(Object, bool, string, int)

> Show the object picker from code.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.0/script-reference/unityeditor.md)
* **Assembly:** UnityEditor

```csharp
public static void ShowObjectPicker<T>(Object obj, bool allowSceneObjects, string searchFilter, int controlID) where T : Object
```

### Parameters

**** (\[Object]\(/engine/6000.0/script-reference/unityengine/object)): The object to be selected by default.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Is selection of Scene objects allowed, or should it only show assets.**** (\[string]\(https\://learn.microsoft.com/dotnet/api/system.string)): Default search filter to apply.**** (\[int]\(https\://learn.microsoft.com/dotnet/api/system.int32)): The id of the control to set. This is useful if you are showing more than one of these. You can get the value at a later time.

### Remarks

Once the user interacts with the Object Picker, it will respond by sending ExecuteCommand events back to the calling OnGUI that called this function. The messages are:

ObjectSelectorUpdated - The selected object was changed. The selected object can be read by calling [EditorGUIUtility.GetObjectPickerObject](/engine/6000.0/script-reference/unityeditor/editorguiutility/getobjectpickerobject.md) ObjectSelectorClosed - The user closed the object picker.
