how to PlayOneShot from a OnCollisionEnter wiith a RaycastHit /Collider>Raycast

hello i have this script

var snd : AudioClip;
var touch : Vector3;
var hit : RaycastHit;
var coll : Collision;

function Update ()
{
    touch[0] = 320/2;
    touch[1] = iPhoneInput.GetTouch(0).position.y;
    touch[2] = 100;

    var ray = Camera.main.ScreenPointToRay (touch);

    if (collider.Raycast (ray, hit, 100)) 
    {
            ??????????coll??????????;
    }

}

function OnCollisionEnter (coll : Collision)
{

    audio.PlayOneShot(snd);

}

that i am using to trigger sound from a touch i just dont know what to write in the boolean condition of the ray for the system to understand to start the OnColliderEnter function

i am doing it because if i playoneshot inside my ray condition it will trigger as long as i have my finger over the mesh

i want to be able to trig on enter , like this i touch and it will play , but it will also play if i drag my finger over the other mesh on the screen

thks

OnCollisionEnter is for rigidbodies or colliders entering the trigger, not for raycasts.

If you want your sound to only play once, you just need some simple logic to check to see what's going on.

Something like this:

var canPlaySound = false;

function Update()
{
    if( // collider function )
    {
        if( canPlaySound )
        {   
            // play sound
            canPlaySound = false;
        }
    }
    else
    {
        canPlaySound = true;
    }
}