using UnityEngine;
using System.Collections;
namespace Chapter1
{
public class Spawner : MonoBehaviour
{
public GameObject objectToSpawn;
public int numberOfEnemies;
private float spawnRadius = 5;
private Vector3 spawnPosition;
// Use this for initialization
void Start ()
{
SpawnObject();
}
void SpawnObject()
{
for(int i = 0;1 < numberOfEnemies;i++)
{
spawnPosition = transform.position + Random.insideUnitSphere * spawnRadius;
Instantiate(objectToSpawn, spawnPosition,Quaternion.identity);
}
}
}
}
There’s my code and the gameobject spawner has the required boxes filled so…
script - Spawner
object to spawn - EvilCube
number of enemies - 1
so why are they not spawning???
Any help would be much appreciated