Search Unity

SerializedObject Losing References Through Version Control

Discussion in 'Scripting' started by massivebacon, Nov 16, 2016.

  1. massivebacon

    massivebacon

    Joined:
    Apr 24, 2014
    Posts:
    27
    Hey Everyone!

    I've been having a problem recently where I'll set references in a SerializedObject to other SerializedObjects (i.e., think of a Brain SerializedObject having a references to an Arm SerializedObject) but will lose these references when pushing code to version control and then pulling down in another computer.

    Perhaps more mysteriously, in VC I see that the files do indeed have their values still set, but I'm getting compiler errors in the inspector for the SerializedObject that state "The associated script cannot be loaded. Please fix any compile errors and assign a valid script." But there are no actual errors with the scripts, and if I make a new SerializedObject it works fine.

    It's also worth saying that I have some functions in my SerializedObjects as well, which makes me wonder if perhaps, when the assembly is loaded, the classes they reference aren't found yet and hence I get an error without an actual trace of an error?

    If anyone has any insight here it would be much appreciated!