i started new project and created a c# script attached to Main Camera
using UnityEngine;
using System.Collections;
public class Main : MonoBehaviour
{
private GameObject[][] sphere;
void Awake()
{
for (int i = 0; i < 13; i++)
for (int j = 0; j < 11; j++)
{
sphere*[j] = GameObject.CreatePrimitive(PrimitiveType.Sphere);*
sphere_[j].transform.position = new Vector3(2 * i, 2 * j, 0);
sphere*[j].transform.localScale = new Vector3(1, 1, 1);*
sphere*[j].renderer.material.color = Color.red;*
}
}_
private void Start()
{
}
private void Update()
{
}
}
and when i tring if i can see spheres i got errors:
NullReferenceException: Object reference not set to an instance of an object
Main.Awake () (at Assets/Main.cs:13)