Unity Editor can't access 2d lights

Hi

Trying to access the 2D lights in the Universal Render Pipeline - when I go to create a new game object of a 2d light, all five options are greyed out.

I also have this error coming up in the Console which I assume is the problem:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.Rendering.Universal.Light2DEditorUtility.GetRenderer2DData () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.6/Editor/2D/Light2DEditorUtility.cs:103)
UnityEditor.Experimental.Rendering.Universal.Light2DEditorUtility.IsUsing2DRenderer () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.6/Editor/2D/Light2DEditorUtility.cs:115)
UnityEditor.Experimental.Rendering.Universal.Renderer2DMenus.CreateLightValidation () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.6/Editor/2D/Renderer2DMenus.cs:76)
UnityEditor.Experimental.Rendering.Universal.Renderer2DMenus.CreateFreeformLight2DValidation () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.6/Editor/2D/Renderer2DMenus.cs:88)

I have tried re-installing the URP package and also tried different versions of Unity.

Any help with this would be amazing - thank you.

Hey there Andrew, have you had a chance to check out our official documentation on 2d Lights in Universal RP?
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/Lights-2D-intro.html
Hope it helps!

I have the same problem in all Unity versions using URP when trying to setup a new 2D light.
I make everything like in this instruction:

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.Experimental.Rendering.Universal.Light2DEditorUtility.GetRenderer2DData () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.8/Editor/2D/Light2DEditorUtility.cs:103)
UnityEditor.Experimental.Rendering.Universal.Light2DEditorUtility.IsUsing2DRenderer () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.8/Editor/2D/Light2DEditorUtility.cs:115)
UnityEditor.Experimental.Rendering.Universal.Renderer2DMenus.CreateLightValidation () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.8/Editor/2D/Renderer2DMenus.cs:76)
UnityEditor.Experimental.Rendering.Universal.Renderer2DMenus.CreateFreeformLight2DValidation () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.8/Editor/2D/Renderer2DMenus.cs:88)
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)

Don’t know if this’ll help, but I had the same problem. Found I’d missed the step at 2:38 in the video that Mat_os linked above

Hope it’ll get you working

I’m having an issue where I still only have the 2D lights (experimental available.) I don’t know how to remove this.

Make sure to not only assign your pipeline assets in the β€˜Graphics’ settings of your project, but also in the β€˜Quality’ settings (for each of the available quality levels).

2 Likes

Thank you!

Little bit late but thank you so much <3

Thx you a lot