Search and Destroy

Not the game sadly...

When a special bullet goes past the center of my screen it is supposed to destroy itself and then kill all enemies in a certain radius.

Heres my script for the bullet so far. (took out UN-related parts to be smaller)

var bulletSpeed: int;

var explosion: Transform;

    function Update () { 

    if(transform.position.y >= 6){
        Destroy(gameObject); 
      }
    }
    function OnTriggerEnter(  otherObject: Collider        ){

    if(otherObject.gameObject.tag == "enemy"){

        playerScript.playerScore += 100;

        otherObject.gameObject.transform.position.y = 16;

        otherObject.gameObject.transform.position.x = Random.Range(16,19);

        var tempExplosion: Transform;

        tempExplosion = Instantiate(explosion, transform.position, transform.rotation);

        Destroy(gameObject);
    }
  }

how can i make it so that the bullet kills all enemies in a certain area, or even just killing all enemies? thanks :D

Use Physics.OverlapSphere, it returns all Colliders within a given sphere radius.

Edit: you use it like this:

// C#

Collider[] hits = Physics.OverlapSphere(transform.position, 5);
                                  // or some other position and radius here

foreach(Collider c in hits)
{
    // Do something with the game objects here.
    // Access the game objects via c.gameObject.
}