This Instantiate method keeps throwing out an error and i’ve tried different ways to use Random.rotation. Any ideas?
using UnityEngine;
using System.Collections;
public class SS_Control : MonoBehaviour {
public GameObject enemy;
private Vector3 position;
public int enemies;
public int range;
private int x, y, z;
void Start ()
{
for (int i = 0; i < enemies; i++)
{
x = Random.Range (-range, range);
y = Random.Range (-range, range);
z = Random.Range (-range, range);
position = new Vector3 (x, y, z);
Instantiate (enemy, position, Quaternion.Euler(Random.rotation));
}
}
}