- Home /
Question by
SeanLee · May 04, 2013 at 05:42 PM ·
2dinstantiateorthello
Instantiated objects don't transform to desired position
I tried to instantiate objects in Orthello 2D, this works but the objects don't transform to position, they are at the same position as the original object's.
var arrayCount = 0;
for (var j : int = 0; j < 17; j++){
for (var i : int = 0; i < 9; i++){
if (level1[arrayCount] == 1){
Instantiate(brickProto, Vector3(i, j, 0), Quaternion.identity);
}
arrayCount++;
}
}
Comment
I solved this by
var arrayCount = 0;
for (var j : int = 0; j < 17; j++){
for (var i : int = 0; i < 13; i++){
if (level1[arrayCount] == 1){
mapTile = Instantiate(brickProto);
mapTile.transform.position = Vector3(i, j, 0);
}
arrayCount++;
}
}
But if anyone could tell me why the first one doesn't work would be nice.
Your answer
![](https://koobas.hobune.stream/wayback/20220613101526im_/https://answers.unity.com/themes/thub/images/avi.jpg)