# TogglePicking(GameObject, bool)

> Toggles the picking ability of a GameObject.

## Definition

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

```csharp
public void TogglePicking(GameObject gameObject, bool includeDescendants)
```

### Parameters

**** (\[GameObject]\(/engine/6000.6/script-reference/unityengine/gameobject)): GameObject on which to toggle picking ability.**** (\[bool]\(https\://learn.microsoft.com/dotnet/api/system.boolean)): Whether to include descendants.

### Remarks

When includeDescendants is true, a descendant is set to the same picking state as the parent GameObject. When includeDescendants is false, the picking state of descendants are not affected.
