Version: 2023.1
LanguageEnglish
  • C#

BatchRendererGroup.SetErrorMaterial

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 SetErrorMaterial(Material material);

Parameters

material The material to display when there is a problem with a shader or material. If this value is null, Unity does not display anything.

Description

Set the error material for the BatchRendererGroup. This material will be used internally by Unity to render the draw commands referring to erroneous shaders. You can also pass 'null' to this method to unset the material.

When you render with a BatchRendererGroup and there is a problem with the shader or material, Unity doesn't display the default error shader. Use this function to display a given material instead. **Note:** For performance reasons, Unity only displays this material in the Editor and in development builds. Unity does not display this material in release builds.