i have a moving cube and when it collides with 2 cubes at once I would like to destroy the one that I collided first and not both of them
I am using this script for destroying
function OnCollisionEnter(col : Collision)
{
if(col.gameObject.name == "block(Clone)")
{
if(col.gameObject.GetComponent(materials).curTxt == 1){
ActiveDig = true;
score += 100;
yield WaitForSeconds (2 / drillSpeed);
Destroy(col.gameObject);
}