Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Builds crash with Renderer2DData serialization error

Discussion in '2D Experimental Preview' started by steinbitglis, Jan 28, 2021.

  1. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    241
    I'm not sure exactly what causes our crashes, but this is the first error message in the player log.

    We're using Unity 2020.2 and Universal RP 10.2.2
     
    NotaNaN likes this.
  2. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    241
    Code (CSharp):
    1. namespace UnityEngine.Experimental.Rendering.Universal
    2. {
    3.     public partial class Renderer2DData
    4.     {
    5. #if UNITY_EDITOR
    6.         [SerializeField]
    7.         Renderer2DDefaultMaterialType m_DefaultMaterialType = Renderer2DDefaultMaterialType.Lit;
    8.  
    9.         [SerializeField, Reload("Runtime/Materials/Sprite-Lit-Default.mat")]
    10.         Material m_DefaultCustomMaterial = null;
    11.  
    12.         [SerializeField, Reload("Runtime/Materials/Sprite-Lit-Default.mat")]
    13.         Material m_DefaultLitMaterial = null;
    14.  
    15.         [SerializeField, Reload("Runtime/Materials/Sprite-Unlit-Default.mat")]
    16.         Material m_DefaultUnlitMaterial = null;
     
    NotaNaN likes this.
  3. NotaNaN

    NotaNaN

    Joined:
    Dec 14, 2018
    Posts:
    296
    I had this exact issue as well in (what I assumed) all 2020.2 Unity versions. :eek:
    After I upgraded to 2021.1b and Universal RP 11.x.x the issue went away. Hopefully they backport the fix to Universal RP 10.2.x (given that fixing the error should be trivial), but we shall see. :oops:
     
    steinbitglis likes this.
  4. steinbitglis

    steinbitglis

    Joined:
    Sep 22, 2011
    Posts:
    241
    I ended up investigating this for days. What I know is that it goes away if I change which packages are in use in my project, but I can remove almost everything else.
     
unityunity