- Home /
My prefabs have all become completely unlinked!
I accidentally moved my Assets folder, then opened Unity (3). I saw my error and quickly closed Unity, moved the Assets folder back, then reopened Unity. However, it imported the whole project again and straight away everything was screwy... My materials were unlinked to my textures, my scripts were unlinked to my objects, and my prefabs were all unlinked to their instances.
I can relink the textures and scripts, but the prefabs are more difficult. There are a ton of instances of one prefab, and in the Hierachy they are all listed in a pinky colour. I cannot seem to relink them to the prefab, so I can't relink their texture using the prefab.
How do I fix this?
Answer by DaveA · Jan 19, 2011 at 05:20 PM
I wrote a script to help with this. It won't fix everything, but at least will reposition things where they were. Hope it helps:
http://www.unifycommunity.com/wiki/index.php?title=ReplaceSelection
Select the affected objects (you can multi-select), and use this, then choose the original prefab, then hit replace, it will reinstantiate them in place and correctly parented
OH $$anonymous$$Y GOD that is unbelievably fantastic! Thank you so much - I was dreading the thought of doing this by hand, and this is exactly what I needed. Not only that, but I've learned something about Editor scripts, AND about backing up (I had only been backing up the Assets folder!) YOU'RE A STAR.
This website is gone. Is there an updated way for relinking a scene and project folder that are borked?
It just moved, it still exists - that's why stack exchange and similar sites always advise against linking for info. Here's the current link: http://wiki.unity3d.com/index.php/ReplaceSelection
Answer by yoyo · Jan 20, 2011 at 07:45 AM
This won't help retroactively, but I have an editor script that lets you do a deep inspection of the scene, with an option to dump to a text file. You should of course back up your scene regularly(!), but if you also dump to text each time you back up, you not only have the backup, you can also figure out what's changed (by dumping the scene again and comparing the output).
You can find the script(s) here.
p.s. Note that there are some limitations to that script, including an inability to drill into arrays. Not too hard to fix, and I'm open to other suggestions and feature requests.
Answer by noeldc · Feb 09, 2014 at 03:35 PM
Why does this happen anyway? So frustrating. Everything keeps becoming unlinked for me.