Hi,
I want to make some 2d tiles fall down every 5 seconds, they have to be spaced out so they are next to each other.
in the picture is the tiles and i want to make them drop endlessly.
I did think of putting them into a grid system and moveing them into the next place on the y axis but that might be to complex.
I also have it falling atm but when the new blocks instanuate at the top they soon start to overlap.
I was wondering if anybody had any good ideas on how i can achive this in code.

You could maybe use something like
using UnityEngine;
using System.Collections;
public class DropBlocks : Monobehaviour {
public GameObject[] blocksTopRow;
public GameObject[] blocksMiddleRow;
public GameObject[] blocksBottomRow;
public GameObject player;
private int playerHealth = 20;
private int currentHealth;
bool damaged;
bool isDead;
void Start(){
StartCoroutine("dropblocks");
currentHealth = playerHealth;
}
IEnumerator dropblocks(){
Random.Range(blocksBottomRow);
yield return new WaitForSeconds(5);
Random.Range(blocksBottomRow);
yield return new WaitForSeconds(5);
Random.Range(blocksBottomRow);
yield return new WaitForSeconds(5);
Random.Range(blocksBottomRow);
yield return new WaitForSeconds(5);
Random.Range(blocksBottomRow);
yield return new WaitForSeconds(5);
//Keep copying and pasting until the full bottom row should be gone
Random.Range(blocksMiddleRow);
yield return new WaitForSeconds(5);
Random.Range(blocksMiddleRow);
yield return new WaitForSeconds(5);
//Keep copying and pasting until the full middle row should be gone
Random.Range(blocksTopRow);
yield return new WaitForSeconds(5);
Random.Range(blocksTopRow);
yield return new WaitForSeconds(5);
//Keep copying and pasting until the full top row should be gone
}
}
Then You can add in the player code and damage code from Survival Shooter Training Day Phases - Unity Learn