# SetPickingMaterial(Material)

> Set the material that Unity uses to render object picking data using the draw commands in the Scene view.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Rendering](/engine/6000.7/script-reference/unityengine/rendering.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public void SetPickingMaterial(Material material)
```

### Parameters

**** (\[Material]\(/engine/6000.7/script-reference/unityengine/material)): Unity Material.

### Remarks

**Note:** This function does not prevent Unity from unloading this material when you switch scenes. To prevent this, ensure that `Material.hideFlags` contains the flags [HideFlags.HideAndDontSave](/engine/6000.7/script-reference/unityengine/hideflags/hideanddontsave.md). Additional Resources: [BatchCullingViewType.Picking](/engine/6000.7/script-reference/unityengine/rendering/batchcullingviewtype/picking.md), [BatchCullingOutputDrawCommands.drawCommandPickingEntityIds](/engine/6000.7/script-reference/unityengine/rendering/batchcullingoutputdrawcommands/drawcommandpickingentityids.md)
