Search Issue Tracker
Duplicate
Votes
0
Found in [Package]
11.0.0
Issue ID
1307125
Regression
Yes
[URP] NullReferenceException thrown on creating Sprite Light 2D object in the Hierarchy
On creating Sprite Light 2D object in the Hierarchy causes the editor to throw NullReferenceException, 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 > Sprite Light 2D
Actual Result:
NullReferenceException is thrown on creating Sprite Light 2D object in the Hierarchy
Expected Result:
Sprite Light 2D object is created 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:
NullReferenceException: Object reference not set to an instance of an object
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)
UnityEngine.Experimental.Rendering.Universal.Light2D.LateUpdate () (at Library/PackageCache/com.unity.render-pipelines.universal@11.0.0/Runtime/2D/Light2D.cs:317)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Crash on PrepareDrawShadowsCommandStep1 when entering the Play Mode in a specific project
- Physics Layer Collision Matrix's Layer names, checkboxes and hover highlights become misaligned when the Editor's UI Scaling gets changed
- Light/shadow information on an edge of a Terrain tile creates a seam with an adjacent Terrain tile when baking a LightMap
- "Missing types referenced from component UniversalRenderPipelineGlobalSettings on game object UniversalRenderPipelineGlobalSettings..." warning is thrown after switching the Platform to tvOS
- “Metal: Error creating pipeline state (Universal Render Pipeline/2D/Sprite-Lit-Default): Vertex attribute BLENDINDICES0(5) of type uint4 cannot be read using MTLAttributeFormatFloat2 (null)“ when setting GPU Skinning to GPU after opening the project
This is a duplicate of issue #1295244