All enemies shoot from one bullet spawn instead of their own

So my question is why do all my enemies shoot from one bullet spawn point (The bullet spawn of the first enemy to spawn), but not their own? Here’s my shooting code for my enemies:

function Shoot() {

   allowfire = false;
   var instantiatedbullet = Instantiate(bullet,GameObject.Find("EnemyGunSpawn")
          .transform.position, Quaternion.Euler(direction.normalized));
    yield WaitForSeconds(0.75);
    allowfire = true;
}

“EnemyGunSpawn” is the bullet spawn point and direction is just the angle that the player is from the enemy. Any help would be greatly appreciated, and I’m sure it’s a simple solution too that I am over looking.

Ok - it’s because it finds a GameObject without using the hierarchy. It just finds the first one with that name.

So you need to use Transform.Find on the transform of the enemy.

   var instantiatedbullet = Instantiate(bullet,transform.Find("EnemyGunSpawn").position, 
          Quaternion.Euler(direction.normalized));