Alright, I am going to post the code for this script, but since i am working on it, it is VERY messy and slightly confusing. I usually clean scripts up once they start to work.
Like i said it is very messy. The idea here is to fire a cannon when the fire button is clicked. When it fires, it will spawn a cannon ball, and the camera will follow the cannon ball, and watch it hit stuff. Well i got the whole spawning thingy to work (really messy as the transform for it is messed up because the modeler screwed with them). Now the problem is the array that i want to use to track the movement of the cannon ball.
The way to cameraScrolling script is set up (it is the same one used in the 2d Gameplay tutorial made by Unity) is it takes a array, and sets it as the target. So i need to set the newly created cannon ball, to be added to the array, so the script can access it, but it will not work. I have tried many ways but none seem to work. Please help me out, as i am completely lost with arrays.
asked May 14 '10 at 02:50 AM
There are a few different kinds of array available in Unity. The ones defined with square brackets  are not resizable, so you can't use Add or Remove, or any functions which change the size.
For a more detailed description of the various arrays and when you might want to choose each, see this Unity Wiki Article:
answered May 14 '10 at 07:21 AM
You would need to initialize the array
And to add your cannonball to it, just use Push
However, if you wish to use fixed native array, there's a couple of things to remember.
So the code might look like: