private void OnTriggerEnter2D(Collider2D collision) { if (collision.CompareTag("Player")) { GetComponent <Animator>().SetTrigger("Open"); if (cs.connectionLoss >= 5) { cs.connectionLoss -= 5; } Instantiate(lootManager.GetRandomWeapon(), transform.position + (transform.up * 0.5f) + (transform.right * 0.5f), Quaternion.identity); // влияние на шкалу collider.enabled = false; } }