Search Unity

Missing Unity UI Components

Discussion in 'Editor & General Support' started by uhhhhhhh, Jan 27, 2015.

  1. uhhhhhhh

    uhhhhhhh

    Joined:
    Aug 3, 2012
    Posts:
    7
    I wish I could be more precise with my description on the error, but it appears quite randomly that ALL of my Unity UI objects will lose links to their UI components.

    Unfortunately, it appears I'm unable to relink up the specific components, so recreating everything is the only known route.

    For the simplest example, I have a Canvas with several children. The Canvas itself has its Rect Transform and Canvas component, but is missing the Canvas Scaler and Graphic Raycaster. It would be somewhat manageable if I could re-add the components, but I find no way to do so.

    Has this happened with anyone else? So far I have had absolutely no luck with the new UI. I love it when it's working, but this is creating quite the delay in my current project. Hopefully someone else out there has experienced this and been able to come up with an easy fix!
     
  2. chechoggomez

    chechoggomez

    Unity Technologies

    Joined:
    Feb 25, 2013
    Posts:
    91
    Hard to say what might be happening, could you please share an image, video or error on console to get more context about you are seeing?
     
  3. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    What version Unity you are using??
     
  4. uhhhhhhh

    uhhhhhhh

    Joined:
    Aug 3, 2012
    Posts:
    7
    Sorry for the very late response.

    It was happening on 4.6.1 over various patch releases. Since this went on for a while I have not bothered with Unity UI any more, so unfortunately I do not have any images to depict.

    The best comparison would be to any game object with a missing monobehaviour. The problem being I cannot replace a missing UI component because there are no references in the assets to it to re-link it up.

    Sorry for being so vague, I realize I'm not being the most helpful. Just wanted to see if there were others with the issue and whether or not anyone has come up with a solution. It doesn't appear to be a common problem, but I witnessed an entire project becoming corrupt after the issue arises. The project continues to un-link the components at any given time.

    I will say it happened a few times with random Unity crashes. Once I re-opened Unity, the references were long gone.
     
  5. Qbit86

    Qbit86

    Joined:
    Sep 2, 2013
    Posts:
    487
    We are facing the same behavior, and it looks like quite serious issue. The most of our in-game interface is made with legacy NGUI. However some infrequent scenes use new approach of uGUI, and it may be easy to overlook UI bugs there in release. Quite frustrating for the game with millions of installs on iOS and Android.

    The problem was noticed both in Editor and devices on different versions of Unity:
    • 4.6.0 and 4.6.1 OS X (Pro) targeting iOS and Android
    • 4.6.0 Windows (Free) targeting WP8
    Canvas node in inspector complains “Missing (Mono Script)” with yellow triangle exclamation mark: “The associated script can not be loaded. Please fix any compile errors and assign a valid script”.

    Asset files don't look harmed (no changes in git), rater Library/ (not versioned) seems corrupted. Cleaning Library/ folder and reimporting assets fixes the problem. But it's not a solution, occurrences seem to be unpredictable and are not easy to detect on automated build server.

    Please, let me know if there are any details on this issue! Maybe it is explicitly fixed in 4.6.3p2?
     
  6. uhhhhhhh

    uhhhhhhh

    Joined:
    Aug 3, 2012
    Posts:
    7
    I have no updates on my end, but I'm curious if you were able to pinpoint the cause of the missing components.
     
  7. idurvesh

    idurvesh

    Joined:
    Jun 9, 2014
    Posts:
    495
    Just now same occured to me
     
  8. johnryork

    johnryork

    Joined:
    Jan 18, 2015
    Posts:
    5
    This just happened to me in Unity 5.2.4f1 on OSX after a hard crash of Unity. Unity wouldn't even restart the next load, it just complained about memory streams being corrupted and started an infinite loop of popups with an error in the Editor and then the crash reporter. Unfortunately, I didn't grab the specific error. I had to force kill Unity to get it out of the loop. One of the two crashes definitely messed something up.

    I had been running some editor scripts to copy assets around, so it could have something to do with that. I did notice I had a couple zombie material instances in my Materials folder that I couldn't delete. These have all gone away when I restarted, but could have contributed to the original crash.

    I haven't tried reimporting assets since in my project that takes forever and is very frustrating...and may not fix the issue.

    This problem has happened to me in the past as well with 4.X versions. All using the new UI. I also see no changes in my git that could explain the issue. I reverted to a known working state to no avail. My Library folder is not versioned.

    Here's a screen shot of the broken Canvas Scaler and Graphics Raycaster scripts:

    Screen Shot 2016-02-21 at 8.06.22 PM.png
     
  9. johnryork

    johnryork

    Joined:
    Jan 18, 2015
    Posts:
    5
    Removing the Library folder and waiting for the reimport fixed it. Phew.
     
  10. canyon_gyh

    canyon_gyh

    Joined:
    Aug 15, 2018
    Posts:
    48
    how can i get the Missing(Mono Script) and Remove it by Script( this Script in editor,it is a stand alone script )