Search Unity

Feedback I would like to know names of my "missing scripts"

Discussion in 'Prefabs' started by LootHunter, Apr 7, 2021.

  1. LootHunter

    LootHunter

    Joined:
    May 27, 2017
    Posts:
    66
    I apologize if this is the wrong section to place my suggestion. The thing is, I recently converted one of my old projects to a new Unity 2020.3 and one of the prefabs had a missing script component. I removed it and nothing seems to be broken but still, I was wondering what the script was (as I've said, the project was old and I don't remember everything very well).

    Apparently, there is no way now to learn the name of the missing scripts as they are referenced by some internal Unity id code. So, I was thinking - maybe you can make some table of script names linked to their id codes somewhere? So, if after a situation similar to mine there are missing scripts, at least people would be able to learn what the actual script is missing.
     
  2. pietrodenicola

    pietrodenicola

    Unity Technologies

    Joined:
    Dec 8, 2020
    Posts:
    43
    I couldn't find a proper section either. But this is an old problem related to the fact that asset names are not stored anywhere. Once an asset is imported in Unity, it gets an ID that is unique. And once the asset is missing, there is nothing we can do with that ID to retrieve the name or anything about the missing asset.
     
  3. LootHunter

    LootHunter

    Joined:
    May 27, 2017
    Posts:
    66
    I see. Still don't understand why there can't just be a table with IDs and corresponding asset names somewhere in the project.
     
    Ony and Marc-Saubion like this.
  4. pietrodenicola

    pietrodenicola

    Unity Technologies

    Joined:
    Dec 8, 2020
    Posts:
    43
    Unity works with IDs, not with names. And I personally think is a valid design.
    So, the name of the asset is known only via the file name itself. That means that when the file is removed, there is no way to retrieve the name of the asset anymore. Unless you restore the deleted file in some way...
     
  5. jdrewsen

    jdrewsen

    Unity Technologies

    Joined:
    Mar 28, 2011
    Posts:
    204
    We do in fact have a table for looking up names by ID internally that we could use. All this is stored in the Library folder which users are allowed to (and often do) delete since it is just a caching folder. So if we were to introduce this functionality it would come with the caveat that once a user deletes the Library folder it would fall back to just showing "Missing script component". I may be an ok behavior though. I will add your suggestion to our backlog so we can discuss it internally.
     
  6. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,443
    is there specific file/files in the library that we could look into, or something that we can access with reflection, while waiting for that feature.. next week/month? : D