Universal Render Pipeline 2D lights giving null reference exception
Hey there, I'm trying to add the experimental 2D lights to my project but I get a Null Reference every time i try adding one.
I'm using 2019.3.f05 and this is the exception I get:
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.7/Editor/2D/Light2DEditorUtility.cs:103)
UnityEditor.Experimental.Rendering.Universal.Light2DEditorUtility.IsUsing2DRenderer () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.7/Editor/2D/Light2DEditorUtility.cs:115)
UnityEditor.Experimental.Rendering.Universal.Renderer2DMenus.CreateLightValidation () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.7/Editor/2D/Renderer2DMenus.cs:76)
UnityEditor.Experimental.Rendering.Universal.Renderer2DMenus.CreateFreeformLight2DValidation () (at Library/PackageCache/com.unity.render-pipelines.universal@7.1.7/Editor/2D/Renderer2DMenus.cs:88)
UnityEditor.GenericMenu:CatchMenu(Object, String[], Int32)
Bumping submission again. It's been a bit and I updated to 2019.3.0f5, but the error is still there.
Answer by rogvc · Jan 06, 2020 at 05:49 AM
Contacted Unity and they told me to try this tutorial:
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/Setup.html
I followed the tutorial and it worked for me. Be sure to delete the old LWRP Asset to be sure, it is working. Recreate the URP Asset and the 2D Renderer and assign it in your settings.
Answer by crempp · Jan 05, 2020 at 11:55 PM
I'm getting the same error in 2019.3.0f3 and 2019.3.0f1.
Answer by Gijaroze · Jan 29, 2020 at 09:27 AM
I have same problem. Anyone got solution?
Contacted Unity and they told me to try this tutorial:
https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/Setup.html
Worked for me!
Your answer
Follow this Question
Related Questions
Changing URP 2D Lighting in script 0 Answers
Black screen error after build Unity URP project 0 Answers
Missing depth output in URP shadergraph graph settings 0 Answers
Custom shader Upgrade to URP {pinkish} 0 Answers
Low Fps on URP on Android 0 Answers