Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on March 30, 2023, between 5 am & 1 pm EST, in the Performance Profiling Dev Blitz Day 2023 - Q&A forum and Discord where you can connect with our teams behind the Memory and CPU Profilers.
    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:
    245
    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:
    245
    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:
    317
    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:
    245
    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.