- Home /
GUITexture placement
I have a problem with placing a GUITexture on the Top left corner.
GUITexture_Object.texture.pixelInset= Rect (0, 0, 10, 50); should create a image on the top left of my screen (Taken from the Scripting guide), however my object is not at (0,0)- since that is the at most left placement, but appears to be a few hundred pixels off. Looking like (200,400).
I know I am referencing the the GUITexture correctly because I am can see the size of the GUITexureObject form a 10x50 area.
It should be noted that I created a player Object with the main camera attached, and a script calling the GUITexture object.
The GUITexture is created and is placement away from the player Object, but is still visible on screen in the Game viewer in the editor, and is referenced in the Inspector on the player's script.
Do I have to place the GUITexture into the Player Object to inherit the right position, or did I miss something vital?
Answer by Berenger · Feb 06, 2013 at 09:04 AM
The transform's position matters for GUITexture. In your case, you need x and y to be equal to 0. And I always found them difficult to handle as soon as they are children of an other GameObject, make sure they're on top of the hierarchy.
Your answer
![](https://koobas.hobune.stream/wayback/20220613092229im_/https://answers.unity.com/themes/thub/images/avi.jpg)