private void OnTriggerEnter2D(Collider2D collision) { if (collision.gameObject.CompareTag("Player")) { //play activated animation & sound doorBehaviour.ActivateKey(); col.enabled = false; GetComponent <SpriteRenderer>().enabled = false; } }