void OnCollisionEnter(Collision collision) { if (collision.gameObject.layer == 8/*the layer number*/ ) debug.log(collision.gameObject.layer.number.ToString() "touched") }