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]; Music[Number].Play(); } void Start(){ MyMusic(Random.Range(0, Music.Length)) } void Update(){ if (!Music[MusicPlays].isPlaying){ MyMusic(Random.Range(0, Music.Length)); } }
Leave a Reply