Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

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

Discussion in '2017.1 Beta' started by ProtonOne, Jun 4, 2017.

  1. ProtonOne

    ProtonOne

    Joined:
    Mar 8, 2008
    Posts:
    406
    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.
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,116
    ProtonOne likes this.
  3. Westyfu

    Westyfu

    Joined:
    Mar 30, 2015
    Posts:
    16
    Just ran into the same thing here, Thanks for making the report!
     
unityunity