OnCollisionEnter only fires once on roll-a-ball test scene

I've set up a scene with five static cubes, each with a box collider, arranged in a plus pattern with one dropped down to form a sort of diorama. I then have a ball with a rigidbody fall into the space created by the cube formation that can be controlled by the arrow buttons. When the ball hits one of the walls, I'd like it to play a sound - or in this simple case, just output something silly like "ouch" to the console. As the documentation and many answered questions say, I put this output in OnCollisionEnter, like so:

function OnCollisionEnter(collision : Collision) { Debug.Log("Ouch!"); }

I stuck it in my roll-a-ball script that is controlling the ball.

The challenge I am having here is that the ball falls down onto the floor, hits the floor, says "ouch", and then that's it. If I bounce it around into the walls, I get nothing. I also tried having this in a script attached to the walls - same result.

Can somebody please tell what, if anything, I am not doing correctly here?

Thanks In Advance, Tom

There is nothing wrong with your script. What is happening is that the consol, to save space, is not showing the message more than once. Try this:

var i : float;

function OnCollisionEnter()
{
  i++;
  debug.log("ouch"+i);
}

This will, of course, not be used in the actual game, just for testing.

You could also try to make it play a sound, like this:

var audioClip : AudioClip;

function OnCollisionEnter()
{
var sound : AudioSource = gameObject.GetComponent(AudioSource);
sound.PlayOneShot(audioClip);
}