void Update() { if (!Input.GetMouseButtonDown(0)) { return; } Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out var hit, 100.0f)) { Debug.Log(hit.transform.name); if (hit.transform.tag == CardTag) { CardBehaviour behaviour = hit.transform.GetComponent <CardBehaviour>(); behaviour.RevealCard(); } } }