instantiated preferb

how to instatiate preferb continuously from specific position can any one help me i am having following code

`var a8Obj :Transform;

for (var i : int = 0;i < 1; i++) {

Instantiate (a8Obj, Vector3(1902.958, 1108.884, -2158.808), Quaternion.Euler(270,359.2464,0));

}`

i want to instantiate a clone of this preferb beside this position in this loop

Think very carefully … you have an integer i that is incrementing, you also want to increment the position, well just use the two together! Now look at Instantiate, where it takes a position as a Vector3, that is what you want to modify

var a8Obj : Transform;
var spacing : float = 1.0;

function Start()
{
    for (var i : int = 0;i < 1; i++) {
        Instantiate (a8Obj, Vector3( parseFloat( i ) * spacing , 0, 0), Quaternion.identity );
    }
}

with this example you can see that for each for-loop, position X is calculated by

parseFloat( i ) * spacing

this just means turn i into a float (not an int), then multiply it by spacing. So if i == 0, x =0; if i == 1, x = 1; if i == 2, x = 2; etc etc

if spacing was 2.5, if i == 0, x = 0; if i == 1, x = 2.5; if i == 2, x = 5; etc etc

//in Start function:

var a8Obj :Transform;

function Start(){
for (var i : int = 0;i < 1; i++) {
var abc : Transform= Instantiate (a8Obj, Vector3(1902.958, 1108.884, -2158.808), Quaternion.Euler(270,359.2464,0)) ;
}

,Make a CS script.

now to instantiate your prefab :

//in Start function:

void Start(){
for (var i : int = 0;i < 1; i++) {
Transform abc = Instantiate (a8Obj, Vector3(1902.958, 1108.884, -2158.808), Quaternion.Euler(270,359.2464,0)) as Transform;
}`