Search Unity

Strange Bug; UI Not Showing Up

Discussion in 'UGUI & TextMesh Pro' started by Nosada, Jun 17, 2019.

  1. Nosada

    Nosada

    Joined:
    Aug 6, 2013
    Posts:
    69
    I am having a very strange bug where my player menu doesn't show up. It's a little hard to explain, so please bear with me.

    My player menu consists of several UI elements on the canvas, images and text. I play the game, and when I open the player menu for the first time, it works completely fine and continues to work fine until I proceed onto the next scene. When the next scene is loaded and I try to open the player menu, the UI elements are invisible. I checked in the scene view to be sure that the player menu and the UI elements are active, and proper scale and all that stuff; they are all active and correct but the text and images are not visible.

    The strange part is that when I pause the game (in the Unity editor) and then resume the game, the UI elements become visible and the player menu works completely fine again. This has me totally baffled, but the only thing that I can think that might be related is a weird warning message I received.

    "No script asset for GameObjectSelectionItem. Check that the definition is in a file of the same name."
    I can't say for 100% certain that it is the cause, but I think it's related. I searched for this and people say it's related to animations.

    Does anyone know anything about this?
     
    Last edited: Jun 17, 2019
  2. Nosada

    Nosada

    Joined:
    Aug 6, 2013
    Posts:
    69
    Here is a video showing exactly what I am talking about.
     
  3. Nosada

    Nosada

    Joined:
    Aug 6, 2013
    Posts:
    69
    Ok so it turns out all I had to do was delete the canvas this was on and put it on a new canvas. Nice bug, Unity.
     
    Last edited: Jun 20, 2019
  4. yengNami

    yengNami

    Joined:
    Feb 14, 2021
    Posts:
    14
    Man, I had a problem like this. and found your solution. I wasted time and scratching my head as to why my UI suddenly became invisible. until I tried putting it in a brand new canvas. It worked. cheers.
     
  5. jaypordy

    jaypordy

    Joined:
    Feb 25, 2020
    Posts:
    2
    Disable and Enabling the canvas would do the trick too.

    I think this happens due to memory leaking issues. Try using the profiler and see if there are no memory leakages.
     
    JackBuilt likes this.