Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

removing "dangling" dependencies

Discussion in 'Editor & General Support' started by sschoellhammer, May 18, 2020.

  1. sschoellhammer

    sschoellhammer

    Joined:
    Feb 15, 2013
    Posts:
    46
    Hello,

    when a field in a script (or shader for that matter) gets removed, unity will keep around a reference to the last assigned object to that field. I believe this is by design, as it's convenient to get that assignment when re-adding the previously removed field.

    The problem comes with asset bundles. There, the "remembered" reference will now pull the removed object in as a dependency. The only way I can fix this is by opening the prefab with a text editor and hack it out manually.
    There are similar issues with materials and also animator controllers (just pasting in a state from another controller and deleting it again will forever reference that other controller)

    Now I wonder if there is some button somewhere to "clean up" a prefab/material etc. :)

    Thanks for any pointers!
    seb
     
    Qbit86 likes this.
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,294
    Yeah, we have run into this issue before. See this thread. There's a link to a tool on the bottom of the thread that may or may not work for you - we've only tested it on our project.
     
    Qbit86 likes this.
  3. sschoellhammer

    sschoellhammer

    Joined:
    Feb 15, 2013
    Posts:
    46
    Thanks @Baste, I'm taking the discussion there :)