using UnityEngine;
public class BlockSpawner : MonoBehaviour
{
public Transform[] spawnPoints;
public GameObject blockPrefab;
public float timeBetweenWaves = 2f;
private float timeToSpawn = 2f;
void Update()
{
if (Time.time >= timeToSpawn)
{
spawnBlocks();
timeToSpawn = Time.time + timeBetweenWaves;
}
}
void spawnBlocks() // I want to add another one of these and i want it to pick from them
{
int randomIndex = Random.Range(0, spawnPoints.Length);
for (int i = 0; i < spawnPoints.Length; i++) // i want to add one like this for (int i =1;i