I have this problem: I create an empty GameObject (GameObject->Create Empty). To that object I would like to add a GUIText (or a GUYTexture) so I select the object form the Hierarchy and choose Component->Rendering->GUIText.
the component is added to the Empty Game Object, but I can’t see it on the screen.
i’ve Given the a value to the GUIText, and well, as the camera is Selected, the GUIText is its component so I HOPE it falls in the camera frustum. I’m talking about GUIText not 3DText.
It sounds as if the position of the GUIText is outside of the normalized screen coordinates. It’s wants a transform position between 0 and 1 on both the x and y axis.
A gui element does not exist in the 3d world, only in screen space. It therefore uses a normalized value (resolution independent) for it’s transform component so you can move it about on the screen.
I’m sure it’s covered somewhere in the GUI scripting guide.
Not at all, using normalized values makes perfect sense in many situations. Screen positioning being one of them. You may notice that functions in the API such as Camera.WorldToViewportPoint work the same way, returning normalized screen coordinates. .5/.5 will be positioned exactly the same, no matter what the aspect ratio or resolution.
I might argue though that 0,0 should be in the top left instead of the bottom left.