using UnityEngine;
using System.Collections;
public class PrefabSpawn : MonoBehaviour {
public GameObject[] items;
int X = Random.Range(0,2);
void Awake()
{
Instantiate (items[X], new Vector3(0,0,0), Quaternion.identity);
}
void Update () {
}
}
Here’s my code, it’s supposed to spawn a prefab from a table, but it always spawns the one stored in items[0]. I found similar questions, but it is a seed problem, and I don’t think it can fit my problem cause I’m not setting seed.