Script for sound

Hi, how can i play multiple sound for a character? i’m using FPSWalker script and i would like to play different sounds when the player moves forward or backward.This is the code that i’m using. Is a way to play sounds without attaching them to an object as Audio Source? or can i attach multiple audio sources?
if (Input.GetAxis (“Vertical”)){

animation.Play(“run”);
}

if (Input.GetAxis (“Horizontal”)) {

animation.Play(“run”);
}
}

http://forum.unity3d.com/viewtopic.php?p=189643
As you can see, you can always alter the pitch to vary the sound.

http://forum.unity3d.com/viewtopic.php?p=189643
As you can see, you can always alter the pitch to vary the sound.

I have a simmilar question:

I have a event and it plays a sound.
I would like to have 3 files an one being played randomly each time.
I am thankful for infos.

Attach the Audio Source component to your Game Object.

In the Script, expose some audio clip variables to the inspector:-

var sound1 : AudioClip;
var sound2 : AudioClip;
var sound3 : AudioClip;

… and then assign the actual sounds in the inspector to these variables.

Then you can play any of the sounds from this single Game Object, like this:-

audio.PlayOneShot(sound2);

To make it play a random sound, put the available choices into an array, then generate a random number to pick the array element…

Does that do it?