How to Center GUI On the Screen IOS

I am designing the main menu on a game i m working on but when I export to a device the position changes. How can i make it so it centers on the screen no matter what resolution the device is? Thanks!

use Screen.width and Screen.height

like so :

float myWidth = 100.0f , myHeight = 100.0f;

  GUI.Button(new Rect( (Screen.width - myWidth) /2,(Screen.height - myHeight)/2,myWidth,myHeight) ) , "Hi");

One way of doing it is to calculate the position after getting the Screen size;

position X = (Screen’s width/2) - (object’s width/2),
position Y = (Screen’s height/2) - (object’s height/2)

this way it will always adjust itself based on the device’s screen. You might also want to adjust the size of your object to follow the screen size instead by using calculations than just inputing number, so the screen will look the same regardless of device’s screen size.