Search Unity

UI Not Showing Up?

Discussion in 'UGUI & TextMesh Pro' started by SprinkledSpooks, Jan 30, 2017.

  1. SprinkledSpooks

    SprinkledSpooks

    Joined:
    Jun 1, 2016
    Posts:
    117
    I previously made a UI Text element that showed two labels on each end of the camera view that read "Score:", and below said labels, would be the value of the players score. Of course, this value is suppose to be blank. However, for some reason all of these labels are not showing up in play mode nor in scene view. I'm also getting very odd errors in the console. Here is a picture to provide context, along with the errors:

    This all seemed to occur after I made a prefab of the Canvas. I'm not sure if that has anything to do with it. Any idea what's going on?

    Edit: Due to the weird errors, I suspect this may be a 'glitch' with the engine itself, and I fear I may have to create a new project. Could this be true?
     
    Last edited: Jan 30, 2017
  2. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    You probably don't have to create a new project. One possible thing is your text might be to large for the box it's in. Try making it smaller and see if it appears. You could also delete it and create new ones.

    If you can clear the errors, you're probably fine. I honestly don't know what those mean, so I can't give you much advice on those. Personally never tried to make a prefab from a canvas, so I'm not sure what results you'd get from that. I do see your canvas is red, which means you deleted the prefab without disconnecting the prefab from it first.

    I can't offer much more advice, but I doubt you've lost everything. But, always remember to make backup copies! Just in case.
     
  3. SprinkledSpooks

    SprinkledSpooks

    Joined:
    Jun 1, 2016
    Posts:
    117
    Thanks for your suggestions! It turns out that when I made my canvas into a prefab, it must have shrunk the size of the text boxes, because the text wasn't able to fit in the box like you suggested. The thing that caught me off guard was, along with those odd errors, whenever I built the game and tested it, the UI showed up anyway.

    P.S. I will certainly be making more backups in the future, in case I do ever run into a more critical issue!
     
  4. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,188
    Glad it wasn't anything major and you didn't have to redo an entire project!
     
  5. ratneshpatel

    ratneshpatel

    Joined:
    Oct 10, 2017
    Posts:
    21
    The same issue occurred to me. I had a childed canvas with lots of child UI elements. When I made the Canvas a Prefab everything got Blank.

    Turns out the scale was reset to 0,0,0.

    This is a bug and Unity should fix it.
     
    Masterben135 and afrederick like this.
  6. psyydack

    psyydack

    Joined:
    Aug 30, 2013
    Posts:
    93
  7. iam11yearsoldboiiiii

    iam11yearsoldboiiiii

    Joined:
    Mar 11, 2021
    Posts:
    7
    I wish i was this lucky
     
  8. iam11yearsoldboiiiii

    iam11yearsoldboiiiii

    Joined:
    Mar 11, 2021
    Posts:
    7
    The ui option isnt there and it isnt in the game object option either but no one will even
    reply cause im replying 8 years after the most recent message
     
  9. gustavohp05

    gustavohp05

    Joined:
    Mar 23, 2020
    Posts:
    1
    solo hay que cerrar la pestaña "scene" y luego darle click derecho y "Add Tabb" y luego "Scene" y ya aparece bien
     
  10. dennispr33

    dennispr33

    Joined:
    Apr 6, 2021
    Posts:
    4
    Restarted my PC and it appeared back. Maybe just wrong file loading by Unity