/* Shooting Damage */ void OnCollisionEnter(Collision collision) { //Tank if(collision.gameObject.tag == "Tank"){ tankHealth = collision.gameObject.GetComponent<TankHealth>(); if(tankHealth != null) tankHealth.TakingDamage(shootingDamage); } //TTurret if(collision.collider.tag == "TTurret") { Transform turret = collision.collider.transform; if(turret) turret.GetComponent<Tank_AutoTurret>().TakingDamage(shootingDamage); } Destroy(gameObject); }