hey guys , i wanna achieve like a chain reaction with explosions with a sphere raycast:
°there’s box (1)
°and there’s Box(2) near box(1)
–is it possible to ( when box(1) gets destroyed(explode) , the explosions will affect box(2) and make it destroy(explode) too )
i have this script but it’s not working =( , help thanks !
function Update () {
var hit : RaycastHit;
var hitColliders : Collider[];
hitColliders = Physics.SphereCastAll (transform.position, 100.0, hit, 10);
for (var objCollider : Collider in hitColliders) {
objCollider.root.gameObject.SetActive(false);
}
}