- Home /
Instantion not taking account of position variable.
my code doesn't want to place the instantiated clones in the position specified in Instantiate(go,pos,rot);, the clones are all in the same position as the cloneparent, the print of the clone postion is different from instantiated one.(am just cloning a object that exists in hierarchy)
I have written a fast code to make clones of an object around itself, and then i delete the cloning script from the children object so that it doesnt replicate to infinity:
from RadialClones.JS :
function test(N:int)
{
cube.transform.rotation = Quaternion.identity;
//var pos=Vector3.zero;
for (var k = 0; k < N; k++)
{
print( circle(N,k));
var newone = Instantiate(cube, circle(N,k)*4 , Quaternion.identity);
newone.transform.position = circle(N,k);
Destroy (newone.GetComponent (RadialClones));
}
}
Ok, it's obviously another script that is overriding the position in start function as there are 3 scritps on the cloned obj. sry silly question :)
Answer by MountDoomTeam · Dec 25, 2013 at 11:15 PM
Ok, it's obviously another script that is overriding the position in start function as there are 3 scritps on the cloned obj. sry silly question :)
Your answer
![](https://koobas.hobune.stream/wayback/20220613124842im_/https://answers.unity.com/themes/thub/images/avi.jpg)