Playing audio doesn't work

I’ve got this code:

var PingGood:AudioClip;

function OnMouseOver () {
       if (Input.GetMouseButtonDown(0)) 
       {
       		audio.PlayOneShot(PingGood);
       		Destroy (gameObject);
            ScoreBoard.SCORE = ScoreBoard.SCORE + 100;
            
       }
    }

But when I hit the diamond, it only destroys it and adds 100 point to the score board, but i don’t hear the sound coming of. Why not? Can you guys help? Thanks

I’d say because your destroying the game object that has the audio source on it. However because its PlayOneShot i’m not sure that even matters.

Yeah I also thought that. But should there be a way to help that?

I already found the solution.

var PingGood:AudioClip;

function OnMouseOver() {
if (Input.GetMouseButtonDown(0))
{
audio.PlayOneShot(PingGood);
yield WaitForSeconds(0.6);
Destroy (gameObject);
ScoreBoard.SCORE = ScoreBoard.SCORE + 100;

}

}
I gave the object a audio source and an audio listener.
How can this be transfered into touch?

i usually use some type of singleton audio manager that crossfades music and sounds. so it would be to tell another object to play the sound before it dies.

i think in Unity 4.0 they said that the OnMouse messages will transfer over to mobile.