- Home /
GUIText does not display anything
Hey guys and gurls!
I just started out learning C# in Unity, my prior scripting expirience being only Java.
I built the Rolling Ball tutorial project and everything was working well, i actually felt like C# is quite similar to what i already know from Java.
Now i ran into trouble when trying to display something with a GUIText and couldn't find my error for more than an hour.
First: Creating Text with the UI-Text-Script thingy works fine. The text is displayed, it only behaves odd when i try to put it into the top left corner. When i drag it up there on the canvas in the scene view, it still doesnt show up right in the corner when i test the game fullscreen.
Working with the GUIText does not work at all. I have the GUILayer enabled on my Main Camera. I created an empty object and added the GUIText as a component. Now when i reset the transform, write some text, change the font to Arial and the size to 12, it still doesn't display anything at all.
The goal is to get something that says "Count: x" with x being a number delivered from a script. But i cant get the GUI to display anything in the first place :(
Did someone run into that problem already and has a workaround? I'd be extremly pleased as i want to fix that issue before moving on to more complex stuff.
Thanks in advance!
Best, Kawa
Answer by Kawalyn · Apr 09, 2015 at 11:44 AM
Thanks Dota, i already figured out what thr problem was. I am not on my PC right now, but i definitly used the GUIText thingy not unter the canvas.
The problem was that 1) i had the GUI thingy as a child of an empty game object whose coordinates were somewhere at -600/80/-200... you name it ;) 2) i had to render the scene ones for some reason (i guess it had to go through the script onces before displying it?
3) it didnt show up when i used 0/0 in the coordinates, while i thought that this was the bottom left corner. 1/1 didnt work either... but everything in between like 0.5/0.5 and even 0/1 worked.
Thanks for the help anyway, have a nice day :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613192501im_/https://answers.unity.com/themes/thub/images/avi.jpg)