Resize Gui

So I created something basic that has around 6-7 buttons.
It works fine fullscreen with the executable but if you we’re doing this for androids and you got a different sized phone or your doing it for pc and your using the webplayer the buttons wont all show.

They are built for a size and if you have a smaller screen such as 600x400 instead of 1920x1080 you will see nowhere near as many buttons but you will see all of the game.

Anyone know how to fix this?

use Screen.width and Screen.height for declaring

for example

if (GUI.Button (new Rect (400,135,50,40),“Button1”))
{
//any code
}
the same button code can be written in the below format .
from the below code the button can be adjusted to any resolution

if (GUI.Button (new Rect(Screen.width/1.2f,Screen.height/2.4f,Screen.width/9.6f,Screen.height/7.6f),“Button1”))
{
//any code
}