Hi
I have a script thats causes a Game object to clone itself. The clone attaches itself as a child then clones itself. Each clone is slighly rotated and moved.
While it does not cause the code to break I get this error.
This the offending code.
private function seedCell( lAngle : float , bName , leafType ) {
var clone = Instantiate( Resources.Load( leafType , GameObject ), transform.position, transform.rotation );
clone.GetComponent(glife).lSize = this.lSize * 0.98;
clone.GetComponent(glife).count = this.count + 1;
clone.transform.name = bName;
clone.transform.parent = transform ;
clone.transform.localScale = Vector3( 0.001, 0.001, 0.001 );
clone.transform.localEulerAngles.y = lAngle/2;
clone.transform.localEulerAngles.z = lAngle;
clone.transform.localEulerAngles.x = straightAngle;
clone.transform.localPosition.x = 0;
clone.transform.localPosition.y = 0;
clone.transform.localPosition.z = lSize* 0.6;
}
I am not sure if error causes a problem but I think it may slow the code down.
Anyone have any clues how to fix this.
Thanks