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
- Deleting AudioMixer asset throws MissingReferenceException and breaks the Audio Mixer window
- Crash on ScheduleGenerateTilingShape when modifying PolygonCollider2D path count and setting path vertices
- Crash when a scene is created with LocalPhysicsMode::Physics3D
- [HDRP] Light doesn't bounce off terrains
- Unity Hub opens instead of the Unity Editor when launching a project from a Windows command line if a backslash is added to the end of the project path
Add comment