I am trying to build a simple matching game. I would like to use tags and the mouse.
Basically if you click one 3d game object and click another one and they have the same tag I want them both to destroy.
Here is my code so far.
void OnMouseDown(Collider other)
//void OnTriggerEnter(Collider other)
{
if (other.gameObject.CompareTag(this.gameObject.tag))
Destroy(other.gameObject);
Destroy(gameObject);
// Debug.Log("match");
}
}