If you delete a script that is assigned to a GameObject, it becomes impossible to remove the ‘missing’ script from that GameObject. This was not the behaviour in Unity 5.5 or earlier.
Bug Case 917810
Steps
- Run Scene
Problem
“The referenced script on this Behaviour (Game Object ‘TestGameObject’) is missing!”
To Reproduce from Scratch
- Create a C# Script called “TestingScript.cs”
- Create a “TestingGameObject” GameObject in teh Scene
- Assign TestingScript.cs to TestingGameObject
- Run. Ensure no warnings
- Delete TestingScript.cs. Do not delete TestingGameObject
- Look at TestingGameObject. It says it is missing the script (normal)
- Run.
- Warning about missing behaviour appears (NORMAL & EXPECTED)
- Stop the Scene
- Look at the TestingGameObject
Expected Result
GameObject should have a empty script entry with ‘Missing Behaviour’ so you can add a new one or remove it.
Actual Result
The missing behaviour can not be seen. No way to delete or reassign it. You need to delete the the game object to get rid of the warning.