Ok I’m trying to get a sound to play from an array. I want my sound to play using an animation even called from a C# script but I keep getting an error message saying:
IndexOutOfRangeException: Array index is out of range.
Here is what I have as my script set up:
//Random Clips
public AudioClip[] VoiceClips;
public void KITTvoice01()
{
AudioSource.PlayClipAtPoint(VoiceClips[Random.Range (0, VoiceClips.Length)], Camera.main.transform.position);
}