Hey,
I’m following along in the tutorials of a book called “Holistic Game Development with unity” by Penny de Byl and I’m using the latest version of Unity (4.0) and I’m having an issue with an example used.
So I basically just want to create a 2D array of cube’s that I’ve made in javascript but the console tells me that I’m getting an error BCE0019 ‘Transform is not a member of Object’ but I’m certain that I’ve had each place in memory of the array is being instantiated in the array before I attempt at transforming it.
any help would be appreciated. Thanks!
#pragma strict
private var aP:Array = new Array(9);
function Start () {
var maxRow: int = 9;
var maxCol: int = 9;
//Code snippet of what I want
/*for(var row:int = 0; row < maxRow; row++)
{
aP[row] = GameObject.CreatePrimitive(PrimitiveType.Cube);
aP[row].transform.position.y = col * 2;
for(var col:int = 0; col < maxCol; col++)
{
aP[col].transform.position.x = col * 2;
}
}*/
// code that I tried to get the minimum expectation to work
for (var i:int = 0; i < maxRow; i++)
{
aP *= GameObject.CreatePrimitive(PrimitiveType.Cube);*
aP_.transform.position.y = i * 2; _
* } *
}
function Update () {
}