I am having some issues with coding with Unity/MonoDevelop using C#. What I am trying to do is have 30 different locations, however using a randomizer only 20 of those locations will spawn a prefab. I am modifying the script using the Youtube Channel Gamad tutorial on spawning objects (https://www.youtube.com/watch?v=kTvBRkPTvRY). below is what I presently have: `using System.Collections; using System.Collections.Generic; using UnityEngine;
public class SpawnObject : MonoBehaviour { public GameObject BeehivePrefab;
public Vector3 center;
public Vector3 size;
public Quaternion min;
public Quaternion max;
public int spawnCount = 0;
public int maxSpawns = 20;
public GameObject [] selectorArr;
// Use this for initialization
void Start () {
SpawnBeehive ();
}
// Update is called once per frame
void Update () {
while (spawnCount < maxSpawns){
int temp = Random.Range(0, selectorArr.length);
selectorArr[temp].Instantiate;
spawnCount++;
}
}
public void SpawnBeehive(){
Vector3 pos = center + new Vector3 (Random.Range (-size.x / 2, size.x / 2),Random.Range (-size.y / 2, size.y / 2), Random.Range (-size.z / 2, size.z / 2));
Instantiate (BeehivePrefab, pos, Quaternion.identity);
}
void OnDrawGizmosSelected(){
Gizmos.color = new Color (1, 0, 0, 0.5f);
Gizmos.DrawCube (transform.localPosition + center, size);
}
}` In this code I am getting errors on Lines 26 and 27 (lines with int tem and selectorArr).