Play sounds based on their position in an array.

Hello, was wondering if it is possible to play a sound based off a name and a number.

So, this is what I’m trying to do:

soundName +;
soundName +;
soundName +;

I’d like to do this while looping through an array.

I am pretty sure you can do this in Flash, but I’m not sure it’s possible in Unity. Perhaps I have to create a list?

Any help would be appreciated!

This is possible, but it doesn’t work exactly the way you’re assuming it does.
Instead of “soundname +”, it’s going to look more like “soundcollection[0].audio.Play();” <-this is not the exact syntax, just pseudocode.

What you’re trying to do is access array elements.
Check this: