One does not simply add to an array. In JavaScript you might have familiarity with using arrays. You might also be familiar with "adding" to arrays. Well Unity sugarcoated that for you. Arrays are not really re-sizable. When you declare an array in c#, you have to define it right there. If your looking for something similar to re-sizable arrays, use lists. To use Lists in Unity c#, you must add the line " using System.Collections.Generic; " At the top of your code. Declaring a list of Game Objects would go something like this List<GameObject> myGameObjectList = new List<GameObject>(); Then adding to the list would is as simple as myGameObjectList.Add(gameObjectInstance); Then if you really just want an array you would say something like GameObject[] gameObjectArray = myGameObjectList.ToArray(); The API is not what it always seems. Unity has also sugar coated some of its API, some parts to the point where its practically ...
Learn to create games, a blog at a time.