- Home /
GUIText in 2D project is not rendering anywhere
Hi there,
I have some GUIText that I want to place in a scene. It's not rendering. Project is a 2D project.
Camera has GUILayer.
GUIText is in front of camera/in view of camera.
GUIText has size and content to show.
GUIText renders in Game view at default creation location, but disappears from GAme view when I move it. At no point does it render in Scene view.
How do I get the GUIText to render in the Scene view so I can place it properly, and have it show in Game view? Or am I using the wrong object for this task?
As far as I know you can never see GUIText in Scene view, it's more like an emptygameobject in that it is represented by the 3 vector arrows. As far as placing it, in it's transform I believe it takes x/y positions ranging from 0 to 1. so if you do (.5,.5,0) it will be centered in game view.
That's the impression that I got. But it doesn't render in Game view either - hence my problem (rather than just inconvenience).
If while looking at the game view, you do: GameObject > Create Other > GUIText does it show? If so then your problem is likely one of coordinates. That is GUIText lives in Viewport coordinates not world coordinates. Typically you want to position a GUIText object between (0,0) and (1,1).
Aha! Yes you're right Robertu! I see your point.
How then, can I use the translation handles in the scene view to position it properly? Or am I trying to do the impossible? If so, is putting new values into script and then running to check the only way forward?
I'm not sure why you have to run it. You should be able to click on the Game tab or select 'Game' from the 'Window' menu to see the Game view at edit time. In the inspector, if you click and hold just to the left of the input field, you can slid your cursor left and right to change the value. This can be a quick way to get an object close to the correct position.