Destructable Objects - Glass Help

http://forum.unity3d.com/threads/3967-Destructable-Objects-Glass?highlight=glass+break

sorry for bumping old post, but i have question, hot to make this glass break on collision?

so when my in game ball hit glass, it breaks

here code:

var glassPane : GameObject;
var glassCrack : GameObject;
var glassPieces : GameObject;
private var hitAlready : boolean = false;

function Start ()
{
	glassCrack.active = false;
	hitAlready = false;
}

function ApplyDamage (damage : float)
{
	if (hitAlready == false)
	{
		glassCrack.active = true;
		glassCrack.audio.Play();
		hitAlready = true;
	}	
	else
	{
		Destroy (collider);
		Smashed();
	}
} 

function Smashed ()
{
	Destroy (glassPane);
	Instantiate(glassPieces, transform.position, transform.rotation);
	Destroy (glassCrack);
	BroadcastMessage ("BreakGlass", SendMessageOptions.DontRequireReceiver);
	Destroy (gameObject, 3.0);
}

So, if I understand correctly, it currently breaks when you shoot at it, but you want it to break if you collide with it (with a ball, for example). If this is the case, all that you have to do is use OnCollisionEnter() and call ApplyDamage().

As a note, your damage variable in ApplyDamage isn’t being used.