I’m not sure if this is a bug or just a change in implementation, but I can’t find any way to remove null components from game objects.
The inspector used to have small stubs that show “missing script” and would let you delete the reference.
Now, the inspector doesn’t show the missing components, but it does show “Components that are only on some of the selected objects cannot be multi-edited” even when I only have a single object selected.
I know the components are still on the game object - the missing components script from the wiki identifies them, and I can even detect them in the inspector by moving other components up and down (on one of my objects, there are 3 invisible components at positions 4, 5, and 6. When I try to move the 4th visible component upwards, I have to move it up 4 times before it moves above the 3rd visible components).
I think this might be a bug introduced in a recent update, but I’m not sure. If anyone knows a way to get around this and delete the missing components, I’d be grateful to hear it.
This has been happening to me since updating to 4.5.x. Two ways I’ve found to get around it are:
1. Put the original scripts you deleted (the ones it’s saying are missing) back into the Project folder where they were originally, and then open them in a text editor. Add a single blank line to the top of each of them then save them again (don’t ask me why, but Unity won’t see them in this case unless you change them in some way).
Now open your project, refresh, and hopefully the scripts will find their way back to the objects they belong to. Next, remove the components calling on those scripts.
When everything is back to normal, try -moving- the scripts you wanted to delete to a different folder (outside of the Assets folder) and refresh the scene. Does the problem still appear? You must have missed removing a component somewhere.
2. This way works for me -sometimes- but then again, sometimes the problem comes back later. Your mileage may vary. – Just drag any old script into the missing script slot, THEN remove the component.
Again, that’s the simplest way, but it also sometimes reverts back to problems later on.
I hope this helps in some way. That is indeed an annoying issue.