- Home /
how can i place my sprite/gameobject to the upper right corner position of my screen
Is it possible to child my gameObject in my guitext that anchor value is set to topright & alignment is set to right & scale x=1,y=1,z=0) to have an accurate upper right position?
Answer by VioKyma · Jul 22, 2014 at 12:25 PM
You can place it in the upper right, but you will need to figure out what that is in world coordinates.
It is not possible to child a gameObject to a GUI element as they are different concepts entirely.
Your best bet is to figure out the World Coordinates that represent the top right of your current game view. This can be tricky, especially if your Camera is likely to move about. If your camera is fixed, you can do a translation from Screen Coordinates using the camera's ScreenToWorldPoint:
Vector2 topRight = new Vector2(Camera.main.pixelWidth, Camera.main.pixelHeight);
Camera.main.ScreenToWorldPoint(topRight);
You may need to adjust position slightly depending upon your object's width and height though.
For reference, see Camera
Your answer
![](https://koobas.hobune.stream/wayback/20220613154657im_/https://answers.unity.com/themes/thub/images/avi.jpg)