Component for empty GameObject... do not work

Ok guys,

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.

What am I missing?

Cheers,
GC.

The game object is positioned within the camera frustum, correct?

because you haven’t given the text value for the GUIText component.

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.

GC.

Ahh ok.

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.

But GUIText gives you only the Alignement And the Anchor… you can’t really set the position. And morevoer the Pixel offset is Null… :frowning:

GC.

Try changing the transform component of the empty game object the GUIText component is attached to.

Yes , you can…

set the transform positions to (0.5,0.5,0);

But where?! the GUIText is a component of the iTopViewCamera, so… it is part of the camera itself.

ouch you were right! But still i haven’t understand that why :frowning:

and anyway as the camera takes the TOP view of my model, still the text disappear :frowning:

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.

Uhm… ok, I’ll have a read… although… it’s a bit obscure.

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.