Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
11.0.0
Issue ID
1307127
Regression
Yes
[URP] UnassignedReferenceException thrown when Sprite Light Type is selected in the Inspector
On Selecting Sprite Light Type under Light 2D Component in the Inspector causes the editor to throw UnassignedReferenceException, Refer to the attached video.
Steps to repro:
1. Create a new Project with URP Template
2. Project > Create > Rendering > Universal Render Pipeline > 2D Renderer
3. Assign 2D Renderer in the URP Asset
4. Hierarchy > Create > Light > Global Light 2D
5. Inspector > Light 2D > Light Type > Sprite
Actual Result:
UnassignedReferenceException is thrown on selecting Sprite Light Type under Light 2D Component in the Inspector
Expected Result:
Sprite Light Type is selected gracefully
Reproducible on:
2021.2.0a2, 2021.1.0b3, 2021.1.0a10 with pacakge version 11.0.0
Working fine on:
2021.1.0a9, 2020.2.2f1 with package version 10.2.2
Environment:
Windows 10, macOS 10.15
Stack trace:
UnassignedReferenceException: The variable m_LightCookieSprite of Light2D has not been assigned.
You probably need to assign the m_LightCookieSprite variable of the Light2D script in the inspector.
UnityEngine.Experimental.Rendering.Universal.LightUtility.GenerateSpriteMesh (UnityEngine.Experimental.Rendering.Universal.Light2D light, UnityEngine.Sprite sprite) (at Library/PackageCache/com.unity.render-pipelines.universal@11.0.0/Runtime/2D/LightUtility.cs:446)
UnityEngine.Experimental.Rendering.Universal.Light2D.UpdateMesh (System.Boolean forceUpdate) (at Library/PackageCache/com.unity.render-pipelines.universal@11.0.0/Runtime/2D/Light2D.cs:250)
UnityEditor.Experimental.Rendering.Universal.Light2DEditor.OnInspectorGUI () (at Library/PackageCache/com.unity.render-pipelines.universal@11.0.0/Editor/2D/Light2DEditor.cs:820)
UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <37a04eb03f2448cf8503c9b487945f53>:0)
UnityEditor.PopupCallbackInfo:SetEnumValueDelegate(Object, String[], Int32)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Slightly transparent objects disappear completely in Web Player when using RenderGraph
- Visual Scripting Components are hidden behind a throbber when Multiplayer Play Mode is running with at least one local instance
- Video Player does not throw an error when playing a video with unsupported encoding settings
- Errors indicating that TMP Extras were not Imported logged when opening the Render Pipeline Converter Window while in Play Mode
- IL2CPP Player crash on VisualElement_get_hierarchy when calling VisualElement.Add in the Start() method
Add comment