Destructable Objects - Glass Help

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 ()
{ = false;
	hitAlready = false;

function ApplyDamage (damage : float)
	if (hitAlready == false)
	{ = true;;
		hitAlready = true;
		Destroy (collider);

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.