void OnCollisionEnter(Collision collision) { if (collision.collider.tag == "Target") { RandomSpawn rs = TargetSpawner.GetComponent <RandomSpawn>(); rs.OnTargetHit(); } }