How do I merge audio and animation with array in random

by Rangel   Last Updated February 11, 2019 02:13 AM

I made this script it merge audio and string every time the audio is played it calls a name, more always in sync with random.

I wanted to know how I do to insert an array of animation in place of the strings, I tried several logics but none worked

public Text Author;
public String[] Names;
private int MusicPlays;
public AudioSource[] Music;

void MyMusic(int Number){
    MusicPlays = Number;
    Author.text = Names[Number];

void Start(){
MyMusic(Random.Range(0, Music.Length))

void Update(){
    if (!Music[MusicPlays].isPlaying){
        MyMusic(Random.Range(0, Music.Length));

Related Questions

Playing audio based on animation state

Updated May 20, 2018 19:13 PM

Unity accesing external audio

Updated April 23, 2016 08:05 AM

Adding more effects to a Unity3d mixer

Updated October 27, 2017 16:13 PM