ok so i have this code. it does its job perfectly, but i need more knowledge to extended it to do what i want
heres the code:
GridFloor.JS
var tilePrefab : Transform;
var FloorArray = new Array();
var nameN : int = 0;
function Start () {
for(var i : int = 0; i < 10; i++){
for( var j : int = 0; j < 10; j++){
Instantiate(tilePrefab, Vector3(i + 5,0, j + 5) ,Quaternion.identity);
FloorArray.Add(tilePrefab.name +nameN);
print(FloorArray);
}
}
}
what i want it to do is create a 2d array one of the arrays being the x coordinate and the other being the y coordinate. i also want each one of the tiles to have another name from the last one… as you can see with my VAR NAMEN; i was dabbling in it but couldn’t make it work. can anybody help me?