only one onCollisionEnter event is detected

Hi there. I just started out learning unity so please bear with me:

I have a two cubes in my scene. One cube is a floor and the other is a small cube object above the floor.
The small cube object is a rigid body, uses gravity and the material is bouncy.

I want to play a sound when the cube falls and collides with the floor. So i coded this:

using UnityEngine;
using System.Collections;

public class boxCollision : MonoBehaviour {
	public AudioClip collisionSound;
	
	void OnCollisionEnter(Collision theCollision){
		if(theCollision.gameObject.name == "Floor"){
			AudioSource.PlayClipAtPoint(collisionSound, transform.position);
		}
	}
}

now when i attach a sound file, and play the game, the cube drops and the sound is played, but when it bounces back up and hit the floor again, the sound is not play.

Can you explain me why it is not playing the sound again?

A few things. One is to make sure it’s bouncing clear out of the trigger or collider. Try throwing out a debug message OnCollisionExit to make sure the cube is actually leaving the first collision and not just continuing to triggger OnColliderStay.

The other would be to mark your sound stereo so you’re sure to hear from any location in the scene.