TNT in Multiplayer

So im making a game like minecraft, now the TNT - how can I make explosions happen across the network and destroy nearby blocks.

Script on the TNT Block:

var boom : GameObject;

function OnMouseEnter(){
    yield WaitForSeconds(2);
        Network.Instantiate(boom, transform.position, transform.rotation, 0);
        Destroy();
}

Hmm.. do you already have the explosion without networking? Give us some code to start out with.

1 Answer

1

got it - i just add this to the explosion prefab and it works:

function OnCollisionEnter(c : Collider){
    if(c.gameObject.tag ==  "Block"){
        Network.Destroy(c.gameObject);
    }
}