Instantiating platform problem

In my 2d game I have to make infinite platform. three types of platform will be used. When I am Instantiating platforms after some time they collide with each other. is three any other way to create infinite platform or better way. here is my code

public void SpawnPlatform ()
	{
		
		delta += Time.deltaTime;
		
		if (delta - time > 6) {
			
			platform.Add ((GameObject)Instantiate (platformPrefab, new Vector3 (transform.position.x * (-(i)), transform.position.y, transform.position.z), transform.rotation));
			
			time = delta;
		}

How about keeping track of the previous platform, and using Physics.IgnoreCollision() to keep the two platforms from colliding. Here is a bit of untested code to give you the idea:

GameObject go = Instantiate (platformPrefab, new Vector3 (transform.position.x * (-(i)), transform.position.y, transform.position.z), transform.rotation) as GameObject;
if (platform.Count > 0) {
    Physics.IgnoreCollision(platform[Platform.Count-1].collider, go.collider);
}
platform.Add(go);