void OnTriggerEnter2D(Collider2D coll) { GameObject box = coll.gameObject; BoxType boxType = box.GetComponent <BoxType>(); if (type != boxType.type) { livesController.getHit(); print("wrong box"); } else { scoreController.addScorePoint(); print("right box"); } }