Skip to content

Api > Material > SetOverrideTag()


Material.SetOverrideTag(string tag, string val)⚓︎

Sets an override tag/value on the material.

Parameters:⚓︎

Name Type Description
tag string Name of the tag to set.
val string Name of the value to set. Empty string to clear the override flag.

Usage⚓︎

---@type Material
local material;

---@type string
local tag;

---@type string
local val;


material.SetOverrideTag(tag, val)

Extra Detail⚓︎

Will set a tag/value on the material that overrides the value of said tag from the shader. This can be used to make sure replacement shaders (such as rendering DepthNormals) work even if the original shader only supports a certain render type. For example if a shader only supports a specific render type but renders in many ways using keywords, SetOverrideTag can be used fom a custom material inspector to ensure that the material renders correctly even if the shader is replaced.