Using GUI and GUILayout at the same time

Hi everyone, I’ve heard that if you use both GUI and GUILayout at the same time you get lots of errors, is that true? I’ve created a script that uses both GUI and GUILayout and I’ve not recieved any console errors

    Void OnGUI(){
    		GUI.Box(new Rect(Screen.width/3.5f, Screen.height/4,Screen.width/2-50, Screen.height/2+50),"");
    		GUILayout.BeginArea( new Rect(Screen.width/3.5f, Screen.height/4, Screen.width, Screen.height));
          scrollPosition = GUILayout.BeginScrollView (scrollPosition, GUILayout.Width (100), GUILayout.Height (100));

No, in general they can be used at the same time. Most GUILayout functions call internally the GUI functions. They just wrap the layouting around them. The GUILayout functions process the layout event, create layout groups and store them for the repaint event. At Repaint they just call the GUI function with the Rect they got from the layout groups. What might get you in trouble is GUI.Window and GUILayout.Window because of the special event handling.

Mixing single / seperate elements is no problem, but there are some things that aren’t compatible. GUI.BeginGroup and layout elements won’t work as well as GUILayout.BeginScrollView with GUI elements in it.

Is this your whole script? You’re not closing the layout group for the LayoutArea(EndArea) and the ScrollView(EndScrollView). Also your scrollview is empty, so there’s actually nothing to display.