using System.Collections; using System.Collections.Generic; using UnityEngine; public class Obstacle : MonoBehaviour { public List obstacleObjs; private void Start() { Starter(); } void Starter() { int rand=Random.Range(0, obstacleObjs.Count); obstacleObjs[rand].gameObject.SetActive(true); } }