I have this simple little script right here:
using UnityEngine;
using System.Collections;
public class Build : MonoBehaviour {
// Use this for initialization
public GameObject brick;
//public int length = 10;
//public int width = 10;
void Start()
{
for (int y = 0; y < 2; y++)
{
for (int x = 0; x < 2; x++)
{
Instantiate(brick, new Vector3(x, 0, y), Quaternion.identity);
}
}
}
// Update is called once per frame
void Update () {
}
}
That’s all my project does for now, but it freezes every time that I try to play it. Coming from a C++ background, I’m not seeing how a simple nested loop is causing Unity to die on me, unless there’s something specific with the C# language that I’m missing, or something technical with unity, because this is pretty much copied straight from the Unity Documentation.