I saw this error on google many times and now I got it too and just can’t figure out why it’s doing it
and I know it’s 1 of most asked Questions but in all answers I saw I can’t pint point what’s going on here?
because it seems that this error is very random. Does anyone know when it happenes?
and why if I leave only GUI.Box(new Rect(0,0,50,50),“dsfg”); no error
but every time I press a controll I get only 1 error for all layouts even if I remove area
some else script access this script and changes Guib to true or false with event. …
If I get rid of all that GUILayouts I get no more errors why?
void OnGUI () {
GUI.depth = 2;
if (Guib){
GUI.skin = GuiSkin;
GuiF();
}
}
void GuiF(){
GUI.Box(new Rect(0,0,50,50),"dsfg");
GUILayout.BeginArea(new Rect(0,0,Screen.width,Screen.height));
GUILayout.Box("I'm Name");
GUILayout.Box("I'm Health");
GUILayout.Box("I'm Stamina");
GUILayout.Box("I'm Nutrition");
GUILayout.Box("I'm fOOd");
GUILayout.Box("I'm Water");
GUILayout.Box("I'm Bladder S**T");
GUILayout.Box("I'm Bladder water");
GUILayout.Box("I'll get back to this later");
GUILayout.Box("tho I think that's all I need");
GUILayout.EndArea();
}
I’ve read many of this type of errors but just can’t figure out
//ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
//Aborting
//UnityEngine.GUILayoutGroup.GetNext () (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:423)
//UnityEngine.GUILayoutUtility.BeginLayoutArea (UnityEngine.GUIStyle style, System.Type LayoutType) (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUILayoutUtility.cs:190)
//UnityEngine.GUILayout.BeginArea (Rect screenRect, UnityEngine.GUIContent content, UnityEngine.GUIStyle style) (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUILayout.cs:211)
//UnityEngine.GUILayout.BeginArea (Rect screenRect) (at C:/BuildAgent/work/812c4f5049264fad/Runtime/ExportGenerated/Editor/GUILayout.cs:201)
//PlayerS.GuiF () (at Assets/Scripts/_PlayerScripts/PlayerS.cs:52)
//PlayerS.OnGUI () (at Assets/Scripts/_PlayerScripts/PlayerS.cs:42)
thanks in advance
I don't get it. How is it possible that when doing
– MrDos1state = EditorGUILayout.Toggle(state, "My Toggle")the function retains the same value for state between Layout and Repaint?? I'm confused because the MouseDown event is triggered between them, so the return value is making state it's opposite and the re-injected state has then changed between the two events! I'm missing a key element here...