Play sound on trigger, sound is coming from the trigger

I’m a bit of a noob…
I’m using this script to animate an object and play a sound, the animation works fine but the sound is coming from the trigger not the animated object.
Any help is very much appreciated.

var Sound : AudioClip;
var Animator : GameObject;

private var hasPlayed = false;

function OnTriggerEnter(){
hasPlayed = true;



You are assigning the audio clip to the trigger when you use var Sound : AudioClip;. What you need to do is assign a GameObject which has the AudioClip component and call it doing something like this:

var AudioClipContainer : GameObject;