using System.Collections; using System.Collections.Generic; using UnityEngine; public class ZombieMoan : MonoBehaviour { public AudioSource AudioSource; public AudioClip[] sounds; // Start is called before the first frame update void Start() { AudioSource = GetComponent(); //pick a random sound from the array and apply to the source AudioSource.clip = sounds[Random.Range(0, sounds.Length-1)]; AudioSource.Play(); } }