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
- [WebGPU] clearing 2d array texture only clears first slice
- Particle System Renderer icon is missing in Animation window > Add Property context menu
- [Android] Legacy, TMP and UI Toolkit Input Field language toggle to some non-latin alphabet languages does not work with external keyboard
- Crash on keywords::LocalKeywordState::operator when calling ShaderUtil.GetPasskeywords with ShaderType.RayTracing set as the third parameter
- Inconsistent “Remove property” behavior when removing child properties in Animator window
Add comment