void OnTriggerEnter2D(Collider2D colider) { Debug.Log("missle hit"); if (colider.gameObject.layer == LayerMask.NameToLayer("ShootableObjects")) { //Debug.Log("shootable"); projectileController.SetRocketForce(0f, 0f); projectileController.canExplode = false; Instantiate(ExplosionEffect, transform.position, transform.rotation); Destroy(gameObject); } if (colider.CompareTag("Enemy")) { EnemyHealth EnemyHealthManager = colider.gameObject.GetComponent <EnemyHealth>(); EnemyHealthManager.DemageEnemy(Demage); } }