Spawn List of game Objects

I am trying to spawn a list of GameObjects. I have been roaming the documentation and I have tried to do this:

Currently I am getting out of bounds argument. Could anyone point me in the right direction? Thanks in advance.

     public void spawntiles()
{
    for (int i = 0; i < int_tile_spawnrate; i++)
    {
        int f = i - 1;
        Vector2 previous_tile_location;
        if (i == 0)
        {
            previous_tile_location = screenPosition;

            array_tiles.Add(Instantiate(Tiles, previous_tile_location, Quaternion.identity) as GameObject);

        }
        else
        {
            previous_tile_location = array_tiles[f].transform.position + array_tiles[f].GetComponent<Collider>().bounds.size;
            // var vector_previous_tile_position =array_tiles[f].transform.position;
            // vector_previous_tile_position.x = vector_previous_tile_position + Tiles.GetComponent<Collider>().bounds.size;
        }
       

    }
}

You don’t add to your array in the else statement (where i!=0) so when i ==2 f will be 1 but your array count will be just 1. Basically you only add to your array when i == 0.

try changing to
i < int_tile_spawnrate to
i < int_tile_spawnrate.length

Remove int f = i-1
and everyhwere that you have f on line 16/17 replace it with i.

also change if (i == 0) to
if (i = 0)

I would first store the reference to previous_tile_location outside the loop. Then inside your for-loop i would first spawn your Tiles object and then assign the previous_tile_location. This way every time the for-loop iterates, the object is instantiated to the location set in the last loop.

Something like this (untested):

    previous_tile_location = screenPosition;

    for (int i = 0; i < tile_spawnrate; i++)
    {
        array_tiles.Add(Instantiate(Tiles, previous_tile_location, Quaternion.identity) as GameObject);
        previous_tile_location = array_tiles<em>.transform.position + array_tiles*.GetComponent<Collider>().bounds.size;*</em>

}
And if you want append the width of your collider to the position, you could use something like:
previous_tile_location = array_tiles.transform.position + new Vector3(array_tiles.transform.position.x + array_tiles.GetComponent().bounds.size.x, array_tiles.transform.position.y, array_tiles*.transform.position.z));*
Oh that horrible forum code formatting.