- Home /
ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
Hi, what in this code is wrong to cause the following error?
if (fileList.Length > 0 && currentCharacter != null)
{
if(listOfPlayers.Count > 1)
{
// if server, show level picker
if(Network.isServer)
{
int smallestLevel = 999999;
// loop trough player list
foreach(NetworkUser user in listfPlayers)
{
// get smallest characterLevel number
smallestLevel = Math.Min(smallestLevel,
user.characterLevel);
}
for (int i = 0; i < smallestLevel; i++)
{
Debug.Log (selectedLevelIndex + " - " + i + " - " + levelList[i].Number + ": " +
levelList[i].Name);
if (GUILayout.Toggle(selectedLevelIndex == i, levelList[i].Number + ": " + levelList[i].Name, "toggle"))
{
selectedLevelIndex = i;
}
}
}
}
else
{
selectedLevelIndex = 0;
}
}
error on row 23:
ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
This code is ran inside the OnGUI.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220613172158im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Problem creating GUI.Window, Help please! 1 Answer
Distribute terrain in zones 3 Answers
C# yield error 3 Answers
UNITY_MVP_MATRIX error when downloading A* Pathfinding 1 Answer