Hello everyone,
After some time to just creat all my script in the asset/script directory I took the decision to organise un little bit the solution. So I created folders and move all those scripts using visual studio.
Well I’have got 226 script and now it’s well organise but all my gameObject look like that now :
I didn’t change the script name just change fodler but it’s going to be a nightmare to remember which script to reassigne etc…
After quick search it look like it’s impossible to find the name of a missing script but it’s most of the time the script name that changed so maybe one of you have a little solution?
For the next time is there still the problem if i move folder directly in unity insted of doing it in visual studio?
Thanks for you help.
Yep, that’s why ALWAYS move stuff in Unity, and ALWAYS use source control.
Here’s the general process of moving or renaming:
SCRIPTS OR ASSETS ARE MISSING OR BLANK
Some info about Missing script warnings, broken prefabs, GUIDs, renaming GUIDs, etc:
https://discussions.unity.com/t/836322/2
https://discussions.unity.com/t/815173/7
https://discussions.unity.com/t/815173/9
EVERYTHING in Unity is connected to the above GUID, which is stored ONLY in the metafile, and hence why the metafiles ALWAYS MUST be source-controlled.
When Renaming: It is super-easy to inadvertently change the GUID by renaming outside of Unity. Don’t do that. Instead:
- close Visual Studio (important!)
- rename the file(s) in Unity
- in Unity do Assets → Open C# Project to reopen Visual Studio
- now rename the actual classes, and MAKE SURE THE FILE NAMES DO NOT CHANGE!
If you are NOT using source control while you do this, moving / renaming files is an EXTREMELY dangerous process. Use source control at all times so that you can trivially revert if you miss a critical step and damage your project.