Random Sounds (New to arrays and Random.Range)

So I have this code:

var Deaths : AudioClip[];

function Update(){
----------
AudioSource.PlayClipAtPoint(Deaths[ Random.Range(0, Deaths.Length)]);

I found this code (AudioSource…) in a tutorial using C# so I guess it wont work cuz of that since it gives me an error! Plz could someone help my get this to work?

Assets/Scripts/Player.js(72,36): BCE0023: No appropriate version of ‘UnityEngine.AudioSource.PlayClipAtPoint’ for the argument list ‘(UnityEngine.AudioClip)’ was found.

You didn’t specify a position. See the docs for PlayClipAtPoint; you need to specify an AudioClip and a Vector3 at least (plus a volume, though you can omit that if the default of 1.0 is OK).

–Eric

Thank you! :smile: