I have the code down below able to produce a random number but it only turn one object on each time it picks the same object each time no matter the number.
using UnityEngine;
using System.Collections;
public class RandomAudio : MonoBehaviour
{
public GameObject One;
public GameObject Two;
public int Fun;
// Use this for initialization
void Start()
{
Fun = Random.Range(1,3);
}
public void StartMusic()
{
if (Fun == 1)
{
One.gameObject.SetActive(true);
Two.gameObject.SetActive(false);
}
if(Fun == 2)
{
Two.gameObject.SetActive(true);
One.gameObject.SetActive(false);
}
}
// Update is called once per frame
}