GUI problem

I’m trying to make a tablike GUI when you click on a different button a different menu will appear.So the buttons work i checked with Debul.Log but nothing appears on the screen.I will really appreciate if someone helps me with this cause I don’t know what is the problem.Here’s a sample of the code :

//////////////////////////////////////////////////////////////////////////////////////////////////
		//GUI tab for the Room Game List//////////////////////////////////////////////////////////////////
		if(GUI.Button(new Rect(Screen.width*0.02f,Screen.height*0.02f,width , height),"Room List" )){
			GUI.Box(new Rect((Screen.width)*0.1f, (Screen.height)*0.08f, Screen.width*0.39f, Screen.height*0.6f),"as");
			GUILayout.BeginArea(new Rect((Screen.width )*0.1f, (Screen.height)*0.1f, Screen.width*0.5f, Screen.height*0.8f));
	Debug.Log("List of rooms");
	
            GUILayout.Label(PhotonNetwork.GetRoomList() + " currently available. Join either:");

            // Room listing: simply call GetRoomList: no need to fetch/poll whatever!
            this.scrollPos = GUILayout.BeginScrollView(this.scrollPos);
            foreach (RoomInfo roomInfo in PhotonNetwork.GetRoomList())
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label(roomInfo.name + " " + roomInfo.playerCount + "/" + roomInfo.maxPlayers);
                if (GUILayout.Button("Join"))
                {
                    PhotonNetwork.JoinRoom(roomInfo.name);
                }

                GUILayout.EndHorizontal();
            }

            GUILayout.EndScrollView();
	        GUILayout.EndArea();
		}
		//////////////////////////////////////////////////////////////////////////////////////////////////////
		//The GUI tab for creating a custom game ////////////////////////////////////////////////////////////
		if(GUI.Button(new Rect(Screen.width*0.1f,Screen.height*0.02f,width , height),"Custom Game" )){
			GUILayout.BeginArea(new Rect((Screen.width )*0.1f, (Screen.height)*0.1f, Screen.width*0.5f, Screen.height*0.8f));
		       GUILayout.BeginHorizontal();
			Debug.Log("Custom GAME");
			   if(GUI.Button(new Rect(120,100,scene1.width,scene1.height), scene1)){
				this.SceneNameGame="Scene";
			}
			GUILayout.EndArea();
		}

Everything else is appearing as normal -labels , boxes , other buttons but not these guys.

Your code is wrong. Take a double look in the docs, especially what a GUILayout.Button returns.

GUILayout.Button returns True only when the button is released so your code is only executed on the 1 frame.

I used this code in an asset I’m writing, you should be able to adapt it easily (and in some ways it might make life easier for you!)

	void OnGUI(){
		curTab = GUILayout.SelectionGrid(curTab, new string[] {"ItemA","ItemB"}, 2);
		
		switch(curTab){
		case 0:
			
		break;
		case 1:
			

		break;	
		}
	}

Hope this helps!