private void ObstacleExplosion() { Collider[] objectsInExpRadius = Physics.OverlapSphere(transform.position, expRadius); foreach (Collider col in objectsInExpRadius) { if (col.gameObject.tag == "Player") { ShipControls shipSC = col.GetComponent <ShipControls>(); if (shipSC != null) { shipSC.DeathFX(); } ////////////////////////////////////// Rigidbody shipRB = col.GetComponent <Rigidbody>(); if (shipRB != null) { shipRB.AddExplosionForce(explosionForce, transform.position, expRadius); } } else { Obstacle colObs = col.GetComponent <Obstacle>(); if (colObs != null) { colObs.ObstacleDestruct(); } } } }