Referenced Script on this Behaviour Missing - Unable to remove missing component from GO

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

  1. Run Scene

Problem
“The referenced script on this Behaviour (Game Object ‘TestGameObject’) is missing!”

To Reproduce from Scratch

  1. Create a C# Script called “TestingScript.cs”
  2. Create a “TestingGameObject” GameObject in teh Scene
  3. Assign TestingScript.cs to TestingGameObject
  4. Run. Ensure no warnings
  5. Delete TestingScript.cs. Do not delete TestingGameObject
  6. Look at TestingGameObject. It says it is missing the script (normal)
  7. Run.
  8. Warning about missing behaviour appears (NORMAL & EXPECTED)
  9. Stop the Scene
  10. 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.

Hi Doug,
Thank you for reporting this bug! A fix for it is already being reviewed.

1 Like

Just ran into the same thing here, Thanks for making the report!