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. Dismiss Notice

Question [SerializeReference] "Invalid serialize reference type dependency name" error

Discussion in 'Scripting' started by Gooren, Nov 3, 2020.

  1. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    324
    Has anyone else ever encountered the following console error: "Invalid serialize reference type dependency name: '_Library.Gameplay.Interaction.PrismaticJointMechanismParameters, Library Gameplay, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'" (the _Library stuff is ours)

    No idea what is causing this. Inspectors with SerializeReference fields using this type draw normally. But the values randomly restart.

    Help :(
     
  2. Stevens-R-Miller

    Stevens-R-Miller

    Joined:
    Oct 20, 2017
    Posts:
    664
    Post your code and we can have a look.
     
    Gooren likes this.
  3. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    324
    Thanks for reply. I wanted to create an isolated repro project and got stuck immediately by not being able to even get the most basic example going, code:

    Code (CSharp):
    1. public class JointMechanism : MonoBehaviour
    2. {
    3.     [SerializeReference]
    4.     public List<IShape> inventoryMulti;
    5.  
    6.     [SerializeReference]
    7.     public IShape inventorySingle;
    8. }
    9.  
    10. public interface IShape {}
    11.  
    12. [Serializable]
    13. public class Cube : IShape
    14. {
    15.     public Vector3 size;
    16. }
    17.  
    18. [Serializable]
    19. public class Thing
    20. {
    21.     public int weight;
    22. }
    23.  
    This only shows JointMechanism inventory fields labels in the inspector. Not the value.

    I tried in a new project created in Unity 2019.4.13f1 and Unity 2020.1.6f1 and it didn't work in either of these.