I am making a space shooter game and I want to spawn enemies like in Galaga. But I can’t seem to figure it out. Here is the code I have so far. If anyone could help me with this problem I would greatly appreciate it.
using UnityEngine;
using System.Collections;
public class Spawn : MonoBehaviour
{
public GameObject [] spawnpoints;
public GameObject Enemy;
void start ()
{
spawnpoints = GameObject.FindGameObjectsWithTag("Spawnpoint");
int spawn = Random.Range (3, spawnpoints.Length);
Instantiate (Enemy, spawn.position, spawn.rotation);
}
}