Change MeshRrenderer property "Contribute Global Illumination" from script

How to detect from the script what this flag is unchecked ?

Found nothing like this in the Renderer and MeshRenderer components.
In the inspector can be turned off, but not affects on properties like ReceiveGI and scaleInLightmap.

Thanks

1 Like

You can test the StaticEditorFlags.ContributeGI flag on GameObject using:

GameObjectUtility.AreStaticEditorFlagsSet(gameObject, StaticEditorFlags.ContributeGI)
2 Likes