Detecting multiple collisions to find matching objects

I’m trying to use collision detection to find matching tag names. I use leap motion to grab an object and place it in a basket. I then grab another object with the same tag and place it in the same basket. If the tags match, I add +1 to the score and destroy the objects.

For some reason my code doesn’t increment for each new pair.

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class DetectPair : MonoBehaviour {
public Text countText;
private string parentTag;
private int count;
//string tags = new string[2];

void Start(){
	count = 0;
	SetCountText ();
}

void OnCollisionEnter(Collision other) {
	//other.gameObject.tag = tags [0];
	parentTag = transform.tag;
	if (other.gameObject.tag == parentTag) {
		Debug.Log ("Match Detected");
		Destroy (gameObject);
		Destroy (other.gameObject);
		//gameObject.SetActive(false);
		//other.gameObject.SetActive (false);
		count = count + 1;
		SetCountText ();
	} else {
		Debug.Log ("Match not Detected");
	}
	
}

void SetCountText () {
	
	countText.text = "Pairs Matched: " + count.ToString ();

}

}

Just so we are clear. It’s outputting “Match Detected” but the text is always staying “Pairs Matched: 0” ?
What is your countText object? Did you drag a Text object in this script or? You could also put a Debug.Log(count) statement in the OnCollisionEnter method after you increment and also one in the SetCountText method to see what count is. My guess is that it is incrementing but somehow your objects aren’t setup correctly so you aren’t seeing the change.