Trying to take a handful of enemies and spawn random ones in random spots of my side-scroller. below is my code and here is the error I’m reciving:
Assets/Scripts/SpawnEnimies.cs(19,25): error CS1502: The best overloaded method match for `UnityEngine.Object.Instantiate(UnityEngine.Object, UnityEngine.Vector3, UnityEngine.Quaternion)’ has some invalid arguments
Assets/Scripts/SpawnEnimies.cs(19,25): error CS1503: Argument #1' cannot convert
UnityEngine.GameObject’ expression to type `UnityEngine.Object’
Any suggestions?
using UnityEngine;
using System.Collections;
public class SpawnEnimies : MonoBehaviour {
public GameObject[] Enimies; //Assign platform pieces in the inspector
public Vector3 spawnPoint; //Shorter way to grab the position of this platform
void Start () {
print (spawnPoint);
int i = 0;
while (i < 5)
{
spawnPoint = new Vector3(Random.Range(100.0F, 1000.0F), 70, Random.Range(100.0F, 1000.0F));
Instantiate(Enimies, spawnPoint, Quaternion.identity);
i++;
}
}
void Update () {
}
}