Title says at all. Need help with this. Thanks!
first you need to set all transform position xyz to 0 (it makes consistent on window resizing,whatever size is)
then attach script to transform your GUI to top-right pos:
GameObject.Find(“YOUR_GUI”).guiTexture.pixelInset.y=(Screen.height)-NUMBER;
GameObject.Find(“YOUR_GUI”).guiTexture.pixelInset.x=(Screen.width)-NUMBER;
If you want to display GUI from the function OnGUI, you just need to set your Rect properly, something like “GUI.(GUIElement)( new Rect( Screen.width - W, 0, W, H ), … );” and then play with W and H;
If it’s a GUITexture/Text, it’s eagleMaster7’s answer.