Version: 2022.3
LanguageEnglish
  • C#

BatchRendererGroup.SetPickingMaterial

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public void SetPickingMaterial(Material material);

Parameters

material Unity Material.

Description

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

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