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

MissingReferenceException: The object of type 'Image' ...

Discussion in '5.4 Beta' started by LHMatsuoka, Jan 15, 2016.

  1. LHMatsuoka

    LHMatsuoka

    Joined:
    Jul 2, 2015
    Posts:
    14
    In Unity5.3 it will work properly.
    But it does not work correctly in continue to be output error Unity5.4.0b2.
    The will or will behavior has changed of uGUI?

    MissingReferenceException: The object of type 'Image' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEngine.Component.GetComponent[CanvasRenderer] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineComponentBindings.gen.cs:48)
    UnityEngine.UI.Graphic.get_canvasRenderer () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:207)
    UnityEngine.UI.Graphic.get_depth () (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/Graphic.cs:158)
    UnityEngine.UI.GraphicRaycaster.Raycast (UnityEngine.Canvas canvas, UnityEngine.Camera eventCamera, Vector2 pointerPosition, System.Collections.Generic.List`1 results) (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/GraphicRaycaster.cs:225)
    :
    :
     
    Retruate likes this.
  2. phil-Unity

    phil-Unity

    Unity UI Lead Developer

    Joined:
    Nov 23, 2012
    Posts:
    1,226
    Hey, any chance you can try to reimport all on your project? It might be a issue with how the dll get loaded. I know that at times i've run into this and a reimport all solves it. Its not the nicest solution but really not sure what causes it so hard to find a fix.
     
  3. LHMatsuoka

    LHMatsuoka

    Joined:
    Jul 2, 2015
    Posts:
    14
    Hi,
    I was Reimport their project.
    Still it does not change the results.

    For now, after the button is pressed, I have to hide it by moving the button to the outside of the screen. (GameObject.SetActive (false))
    Then, I feel like MissingReferenceException .. the message is out.
    Take a look easy to do can not be reproduced.

    Thank you.
     
    Deleted User likes this.
  4. ChimeraIT

    ChimeraIT

    Joined:
    May 9, 2014
    Posts:
    25
    Hey, we ran into the same Error in Unity 5.4.0b3.
    Before we were using 5.3.1p3 and everything was fine.

    This error always occurs when you are using Destroy(gameObject) in
    a uGUI scene. Seems like a bug to me.

    Reimport all did not help.
    But we found a hotfix: just reparent the target gameObject to
    somewhere else and then destroy it without any error ;)

    Hopefully this gets fixed soon!
     
    LHMatsuoka likes this.
  5. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    This is still an issue for me in 5.4.0b6 and causes all UI input to not work. Re-importing did not fix it.
     
  6. z000z

    z000z

    Joined:
    Dec 31, 2014
    Posts:
    96
    Also having this issue when using a UI Dropdown in 5.4.0b6 (re-importing also did not fix), submitted the project it's case # 772347
     
    LHMatsuoka likes this.
  7. mdrotar

    mdrotar

    Joined:
    Aug 26, 2013
    Posts:
    377
    Any progress on this?