Bomb in Unity problems

Hi, i want to make a game where you can spawn bombs at any time in the game and detonate all of them at once with the press of a button, my spawn script looks like this: `

var prefabBullet:Transform;
var shootForce:float;
function Update()
{
    if(Input.GetButtonDown("Fire1"))
    {
        var instanceBullet = Instantiate(prefabBullet, transform.position, Quaternion.identity);
        instanceBullet.rigidbody.AddForce(transform.forward * shootForce);
    }
}
`

also i want to say im new to shis support thing so please give and explain full code and not just pieces of it or i will not understand, ive really tried to but i just cant... Thank you!

So when you click.. It spawns a bomb...

Now you need to make it do something when you push another button, so:

if(Input.GetButtonDown("Fire2"))
{
    //Blow up here.
}

Now, how did you want to make them blow up... Are you going to have them do an animation? Spawn a particle effect? It really depends on how you want to do it...

First you'd want to loop through them all... So add the bombs to an array, then use a for:each loop, and go through them all... Then do the instantiate like you have, but make it instantiate the bombs...

  if(Input.GetButtonDown("Fire2"))
  {
    var blowupPrefab : GameObject;
    var bombs = GameObject.FindGameObjectsWithTag ("Bomb");
    for (var bomb in bombs)
      Instantiate (blowupPrefab, bomb.transform.position, bomb.transform.rotation);
  }

This'll work... Hope it helped. And if you can't code, don't mean to rain on your day, but you wont be able to do much making games wise... I'd suggest reading up and learning... Giving up isn't going to get you anywhere.

.........................

I didnt really got your code to work is there any way you can modify this cod into exploding when i press a button instead of when it hids something?