Unity stop resposding

public class menu : MonoBehaviour {
int userint;
public GameObject torsoSlots;

    void Awake()
    {
        userint = 0;
        for (int i = 0; i < 10; i++)
        {
            torsoSlots*.active = false;*

}
}

void OnGUI()
{
if (userint == 0)
{
GUI.Box(new Rect(Screen.width - 220, 20, 200, 200), “Fit”);
if (GUI.Button(new Rect(Screen.width - 170, 40, 100, 25), “Head”))
{
userint = 1;
}
if (GUI.Button(new Rect(Screen.width - 170, 70, 100, 25), “Torso”))
{
userint = 2;
while(userint == 2) ;
{
for (int torso = 0; torso < 10; torso++)
{
torsoSlots[torso].active=true;
}
}
I’m trying to create a char builder, in public torsoSlots[], there is game object I’m defined. When I click on Torso button unity stop responding. Is it because I did something wrong with code ( enless loop etc ) or just a unity bug.
Thanks in advance…

The code you have inside your Torso button code is an infinite loop. You have a while loop there. The code you posted will loop and never end because you loop while userint is 2. Userint is 2 and never changes.