- Home /
UI elements within canvas are invisible
Hi! I have a canvas and some UI texts inside it. The problem is that they are only visible when I set their position to center of the screen. When I change it to top or any corner, they become invisible. It's quite interesting that it only happens with one canvas. The other one works properly. Both are set to "Screen Space - Camera". There's also another problem. I use these UI texts as player's HUD. I don't know why, but when they're set to "Screen Space - Overlay" they don't keep their position while player is moving. I had to set them to "Screen Space - Camera" to solve the problem, but now every 3D object can cover them... Can You help me?
Are you updating the element positions after you update the anchor point? It would cause things to jump around. You could try temporarily added a really large background image to see if they are just off-screen or really 'invisible'.
Answer by SirDef11 · Oct 06, 2017 at 11:46 AM
Exactly, Unity is FULL OF BUGS like this, EVERYTIME, and you can't know why, you need to rebuild again and again, and to pray that another bug will not happend (which will happend anyway...). It's my 100th bug you know, and i feel very angry now, what a WASTE OF TIME !!!
Answer by SergioSandiaz · Oct 03, 2016 at 06:01 AM
Try to set Canvas to "Constant Screen Size" and use a default size (I normaly use 1366X768), also check the anchors of your GUI elements
Answer by Team_26 · Oct 03, 2016 at 04:50 PM
I tried to set Canvas to ,,Scale with screen size", because there was no option "Constant Screen Size" . It didn't help ;/
Yeah bro, I wrote the name wrong, also set the $$anonymous$$atch width (I think) to 0.5
Sorry for no response. It still doesn't work... I have no idea why.
Answer by Uteki · Feb 09, 2019 at 12:01 PM
I had similar problem while moving object from outside of Canvas into the Canvas. Scale was changing to 0 while parenting.
To fix that you need to set "worldPositionStays" to false while parenting.
uiObject.transform.SetParent(canvas, false);
At least it helped me.
Ps: I hate this retarded way of formatting text, that we have here.
Your answer
![](https://koobas.hobune.stream/wayback/20220612093846im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
UI elements within canvas are invisible 0 Answers
Screen Space - Camera to Screen Space - Overlay switch issue 0 Answers
How can I display text so that it can be see on the Vive Headset? 0 Answers
World Space canvas on top of "everything"? In 2019 0 Answers
Scene Is Missing A Full Screen Camera? 2 Answers