Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    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:
    3,136
    ProtonOne likes this.
  3. Westyfu

    Westyfu

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