Infinite 2D topdown generator

So Im making a 2D top down runner style game where the player avoids edges on the platforms and collects coins. i cant seem to figure out why my script is instantiating the next platforms in the wrong areas…

this is my platform generator script.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlatfomGenerator : MonoBehaviour {


    public GameObject platform1;
    public Transform generationPoint;
    public float distanceBetween;

    private float platformWidth;


    void Start () {

        platformWidth = platform1.GetComponent<BoxCollider2D> ().size.y;
    }
   
    // Update is called once per frame
    void Update () {

        if (transform.position.y < generationPoint.position.y) {

            transform.position = new Vector3 (transform.position.y + platformWidth + distanceBetween, transform.position.x, transform.position.z);

            Instantiate (platform1, transform.position, transform.rotation);
        }
    }
}

Then i set my platform that i want to instantiate next once the generator point is outside the bounds. instead of it instantiating it right after my current platform, it does this…

the two on the right should be directly after the current one. i dont get it.

3105673--234622--Screen Shot 2017-06-12 at 10.13.20 PM.png

bump

In the position assignment, you mixed up your ‘.x’ and ‘.y’ s ? In the start function ,also.
Dunno if that’s it…