How to use the new 5.40 use lightProbeUsage as enumerator on Renderer Component?

Hi everyone,

I have some troubles to use the new lightProbeUsage enumerator syntax on the Renderer component on Unity 5.40.

UnityEngine.Renderer.useLightProbes’ is obsolete: `useLightProbes property is deprecated. Use lightProbeUsage instead.’
Unity - Scripting API: LightProbeUsage

if(UseLightprobes) {
                   // Obsolete by Unity 5.40 
                    GetComponent<Renderer>().useLightProbes = true;
                }
                else {
                    // Obsolete by Unity 5.40 
                    GetComponent<Renderer>().useLightProbes = false;  
                }

var r = GetComponent();
r.useLightProbes ??

Thank you…

1 Like
GetComponent<Renderer>().lightProbeUsage = UnityEngine.Rendering.LightProbeUsage.Off;
3 Likes

Thanks a lot!