Reputation: 23
After foolishly renaming a folder containing a bunch of assets, my textures started rendering pink and I got a bunch of null reference exception errors. I renamed the folder back to it's original name so that everything should now be in the right place, however I am still getting the null reference errors. Does anyone know how to fix this?
Upvotes: 2
Views: 304
Reputation: 20028
I'm assuming the renaming of the folder happened when Unity was closed, correct? If you don't use version control (Git, Perforce, etc.) you are pretty much in a bad spot. You will have to setup your references again.
The problem is the following:
Unity gives every asset and every folder a specific ID. All references in your assets, use those IDs to find out what is what. That is, which material was assigned to your objects, which textures were on those materials, which components were on an object, and so on.
Now you close Unity, change you folder name, and Unity goes "oooh, new folder, let's give that an ID, and all the assets in it as well. Oh, and I know about one folder which seems to have been deleted, so let's get rid of all my knowledge about it".
Panic ensues, and you give your folder the old name again. But given that stuff was referenced by ID and not name ... well, you end up in your current state.
In conclusion:
Upvotes: 2