"Well as the title says i have a spawner script thats running without any errors but nit just wont spawn entitys,
pls can anyone help me.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemySpawning : MonoBehaviour{
public GameObject[ ] Enemy;
public Vector3 spawnValues;
public float spawnWait;
public float spawnMostWait;
public float spawnLeastWait;
public int startWait;
private int randEnemy;
void start (){
StartCoroutine(Spawner());
}
void Update (){
spawnWait = Random.Range (spawnLeastWait, spawnMostWait);
}
IEnumerator Spawner (){
yield return new WaitForSeconds (startWait);
while (true){
randEnemy = Random.Range (0, 2);
Vector3 spawnPosition = new Vector3 (Random.Range (-spawnValues.x, spawnValues.x), 1, Random.Range (-spawnValues.z, spawnValues.z));
Instantiate (Enemy[randEnemy], spawnPosition + transform.TransformPoint (0, 0, 0), Quaternion.identity);
yield return new WaitForSeconds (spawnWait);
}
}
}