My enemy script is crashing Unity (possibly BroadcastMessage)

Hi all,

I'm making a Raiden style top down space shooter, and everything was going fine, til I changed something in my enemy controller script. The enemy was to fire its weapon/s at random intervals, and so I had the controller script instantiate a laser where the child object 'weapon' was found. However I changed this to add compatibility for multiple weapons firing at once. I changed the Fire function in the enemy controller to this:

private var fireRate = 2.0;
private var nextFire : float;

function Fire()
{
    gameObject.BroadcastMessage("Fire");
    nextFire = Time.time + fireRate + Random.Range (0.0, 3.0);
}

And then I created a script to attach to every weapon child in the object:

var laser : Rigidbody;
var laserSpeed = 20;

private var randomVariance = 0.1;

function Fire () 
{
    audio.pitch = 1 + Random.Range (-randomVariance, randomVariance);
    audio.Play();
    var instantiatedLaser : Rigidbody = Instantiate(laser, transform.position, transform.rotation);
    instantiatedLaser.velocity = transform.TransformDirection(Vector3(0, 0, -laserSpeed));
    instantiatedLaser.transform.eulerAngles.x = 90;//For capsule laser
}

Unity doesn't find any errors in the scripts, however when enemies get to -16 on the z axis (the point where they always fire their first shot), Unity itself crashes. With my usual problems stemming from a lack of attention ( ':' instead of '=', or 'U' instead of 'u', etc) Unity pops up with a helpful error, however this time it's not detecting anything, and nor am I.

Any help would be appreciated!

The problem is that the function you're calling from is called Fire too, so it calls itself, over and over again. Rename that, and it should work