#pragmastrictvarradius:int=10;varsphere:Transform;//Sphere Assets
varline:LineRenderer;//LineRenderer Component
functionStart(){vars:float=0;vart:float=0;line=GetComponent(LineRenderer);varindex:int=0;while(t<180){s+=32;t+=0.5;varradianS:float=s*Mathf.Deg2Rad;varradianT:float=t*Mathf.Deg2Rad;varthisx:float=0+(radius*Mathf.Cos(radianS)*Mathf.Sin(radianT));varthisy:float=0+(radius*Mathf.Sin(radianS)*Mathf.Sin(radianT));varthisz:float=0+(radius*Mathf.Cos(radianT));varnewSphere=Instantiate(sphere,Vector3(thisx,thisy,thisz),Quaternion.identity);newSphere.transform.set_parent(gameObject.transform);//Set AbstractShpere as the parent of each sphere
//draw line between shperes
line.SetVertexCount(index+1);line.SetPosition(index,Vector3(thisx,thisy,thisz));index++;}}functionUpdate(){varindex:int=0;for(varchild:Transformintransform){varx:float=child.position.x;vary:float=child.position.y;varz:float=child.position.z;child.position=Vector3(Mathf.Sin(Time.time)*Random.Range(-1.0,1.0)+x,y,z);//redraw lines
line.SetPosition(index,Vector3(child.position.x,child.position.y,child.position.z));index++;}transform.Rotate(1.0,1.0,1.0);}