Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


SetPickingMaterial(Material)

Set the material that Unity uses to render object picking data using the draw commands in the Scene view.
Read time 1 minuteLast updated 6 days ago

Definition

public void SetPickingMaterial(Material material)

Parameters

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. Additional Resources: BatchCullingViewType.Picking, BatchCullingOutputDrawCommands.drawCommandPickingInstanceIDs