Unity freezes when I run this script.,Unity Freezes when I run this script.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

// C#
public class GameController : MonoBehaviour {

	void Start() {
		for (int y = 0; y < 10; y++) {
			for (int x = 0; x < 5; x++) {
				for (int z = 0; x < 5; z++) {
					GameObject cube = GameObject.CreatePrimitive(PrimitiveType.Cube);
					cube.AddComponent<Rigidbody>();
					cube.transform.position = new Vector3(x, y, 0);
				}
			}
		}
	}
}

Of course I post it then I figure it out.

This “for (int z = 0; x < 5; z++)”

should be “for (int z = 0; z < 5; z++)”