Feature Request: Improved serialization of script references

Not sure how I did it, but through an accidental re-import of a code library, all of the GUID’s got reassigned to a bunch of scripts, resulting in several broken script references. It’s not the first time I’ve encountered a broken or missing script problem. The “missing” scripts in this case are not missing at all but Unity can’t match them up. Which got me thinking, why not simply include the fully qualified type name as a backup measure.

m_Script: {fileID: 11500000, guid: c50360ea8e7ae3149b153e108d325ac3, type: 3}

…changes to…

I would propose that if the GUID can’t be found, Unity could then search for the class and try to make use of that instead. This wouldn’t keep the problem from happening in 100% of situations, but it would make Unity far more robust. Even if Unity isn’t able to automatically resolve the problem, the uninformative “Missing Script” messaging could be replaced with "Unity can’t find component class: “Barliesque.Utils.ButtonStateObject”

3 Likes

Why not indeed… I wish Unity had done this 15 years ago… so much waste and loss of human time has come from missing references that this could have solved. You’re right, such an approach isn’t perfect, but I bet it would catch 95% of broken links, plus it would give you insight into almost any broken link.

1 Like

It’s also backward compatible, I believe, as older versions of Unity will simply ignore additional metadata.

Is there a better place to post feature requests? Last I checked something new was planned to replace the Feedback site, but I haven’t been able to find anything.

  • BUMP *

@eduardooriz @LeonhardP @Tautvydas-Zilys @mfuad @simons_unity @BrianRodway @Aras
Happy New Year! Now let’s see if we can get this onto the roadmap, please.