Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Unity UI UI Canvas text not visible at Game

Discussion in 'UGUI & TextMesh Pro' started by mscdroid, Aug 22, 2018.

  1. mscdroid

    mscdroid

    Joined:
    Aug 22, 2018
    Posts:
    3
    Hi everyone! Just a newbie with unity, i'm trying to make a simple 2D game, but my first problem come with canvas & text, as you can see at the images, i have a canvas with text child, while editing i can see them in the scene, but when i change to "Game View" it dissapears.

    I've tried some of "posible solutions" i found on the net but nothing works, some of you guys knows about that?
    I can't figure why is so hard to simply add a text and showing them :S

    Thanks in advance!

    unity1.png unity2.png unity3.png
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,078
    regarding your question:
    Maybe it is because your canvas render mode is set to Camera. Are you sure you need that? In most cases "Overlay" is what you want.
    If you want to stay with camera maybe it helps if you set the canvas Z position to 0 or increase the far clipping of the camera.

    regarding your setup:
    the anchors of your text object are a bit off. It will look wrong on other resolutions.
    Also, you should avoid to scale anything inside the UI unless you are sure about the consequences and can live with them.
     
    iritranda, yl1461 and mscdroid like this.
  3. FernandoHC

    FernandoHC

    Joined:
    Feb 6, 2018
    Posts:
    333
    What @Hosnkobf said, and I would also make the parchments be part of the Canvas UI instead of being sprites, so you can move/adjust them properly, it's just more organized and will save you a lot of headache.

    Just Create a new UI->Image with the parchments, then nest the Text within it, adjusting its rect size to fit it nicely. So when moving the parchment the text will go with it.
     
    therealpowells and mscdroid like this.
  4. mscdroid

    mscdroid

    Joined:
    Aug 22, 2018
    Posts:
    3
    Hi guys! thanks for your answers, I finally fixed! :D I switched to the "Superposition" mode and the Z position to 0. Then I noticed that the canvas was drawn above, but i couldn't move it, so i moved the content to the canvas (background, UI, buttons etc ...) I dont know if it is the best solution, but at the moment it works.
     
  5. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,078
    try different resolutions and you will see if the solution is good enough ;)
     
  6. ScottKelly85

    ScottKelly85

    Joined:
    Jun 27, 2020
    Posts:
    1
    I had the same problem but I changed the Canvas render option to world space and the text appeared in the full screen game window. Sorted.
     
  7. Scouseknight

    Scouseknight

    Joined:
    Aug 11, 2018
    Posts:
    1
    Sorted it for me - thank you so much my friend!
     
    TheDirtyBurger11 likes this.
  8. tyler_shau

    tyler_shau

    Joined:
    Feb 17, 2021
    Posts:
    27
    I had a random Canvas Component on the GameObject containing my text, removed it and the text showed up.
     
  9. aankiqq95

    aankiqq95

    Joined:
    Jun 11, 2021
    Posts:
    1
    Hello Guys, Change canvas scale greater than 0
     
  10. vladinus2

    vladinus2

    Joined:
    Feb 22, 2022
    Posts:
    1
    Worked for me as well. What is the difference? Overlay is set by default ..
     
  11. CassClay

    CassClay

    Joined:
    Mar 21, 2020
    Posts:
    20
    Changing canvas to World Space solved it for me, however the last thing I've just changed was the source of the text, nothing more. Why it was working for so long without breaking is beyond me. Probably it's something Unity does differently when recompiling.
     
  12. EggTheDev

    EggTheDev

    Joined:
    Dec 16, 2021
    Posts:
    1
    Know i'm late but just try changing canvas render mode to "World Space".
     
  13. mscdroid

    mscdroid

    Joined:
    Aug 22, 2018
    Posts:
    3
    Thanks mate for your reply!