So what I’m trying to do is have a selection of audio files play one after the other in random order. I’ve done this by adding an Add Audio Component script for each file to the Level Blueprint, then putting them all in an array to be called in random order. This has worked fine so far, but after the first song plays, nothing happens. I’ve used Print String to test where the blueprint breaks down, and as far as I can tell, the OnAudioFinished event just never fires.
Where are you using “OnAudioFinished”? Could it be that you didn’t bind it properly?
Alternatively if you can’t get it running. Sounds have a length you can get. Instead of using an event like this you could just wire the soundfile length into a delay and build your own “OnAudioFinished” so to speak.
Yeah, it’s likely that I wasn’t using it properly. I followed your advice and was able to fit the whole (now working) blueprint in one screenshot: http://i.imgur.com/dvyvRsM.png
I ended up creating a SoundWave variable for each sound file, then plugging them into an array and getting one at random, and plugging that random song into a variable to be called into the Spawn Sound script and to get the duration of.
The reason I used a variable instead of just plugging it into the Spawn Sound script is because if I did that and then tried to get the song’s duration from the Get From Array script at the same time, I would get another random song’s duration instead of the one that was chosen.
Thank you for your advice. Also please forgive my horrible terminology.
Hwy, can anyone explain exactly how to bind the “OnAudioFinished”? Because the usual way I did it still doesn’t fire the functions I want the event to.
this helped nicely, that duration delay can after that add everything, thanks so much :3