//shooting
    void Shoot()
    {
        RaycastHit hit;

        au.PlayOneShot(au.clip);
        GunKick();

        //for each bullet to be fired per click
        for (int i = 0; i < gun.pelletCount; i++)
        {
            //displace the ray direction by a certain amount
            Vector3 bulletSpread = cam.transform.forward + (Random.insideUnitSphere * gun.accuracy);
            muzzleFlash.Play();
            Ray ray = new Ray(cam.transform.position, bulletSpread);
            if (Physics.Raycast(ray, out hit, gun.range, layerMask))
            {
                //spawn a laser hit effect at the place of impact
                ParticleSystem spawnedSpray = Instantiate(spray, hit.point, Quaternion.identity) as ParticleSystem;
                spawnedSpray.transform.parent = particleParent.transform;

                //check if any of the following enemies were hit and damage them if they were
                Drone d = hit.transform.GetComponent <Drone> ();
                if (d != null)
                {
                    d.TakeDamage(Mathf.Round(Random.Range(gun.damage * 0.8f, gun.damage * 1.2f)));
                    inv.money += 10;
                }
                Mutant m = hit.transform.GetComponent <Mutant> ();
                if (m != null)
                {
                    m.TakeDamage(Mathf.Round(Random.Range(gun.damage * 0.8f, gun.damage * 1.2f)));
                    inv.money += 10;
                }
                BossParts bp = hit.transform.GetComponent <BossParts> ();
                if (bp != null)
                {
                    bp.TakeDamage(Mathf.Round(Random.Range(gun.damage * 0.8f, gun.damage * 1.2f)));
                }
                MissileSeek mi = hit.transform.GetComponent <MissileSeek> ();
                if (mi != null)
                {
                    mi.TakeDamage(Mathf.Round(Random.Range(gun.damage * 0.8f, gun.damage * 1.2f)));
                }
            }
        }
        tc.updateMoney(inv.money);
    }
    //called when anything with this script collides with something else
    //valid collisions are defined by the matrix of physics interactions in Unity's Physics settings
    void OnTriggerEnter(Collider other)
    {
        //ignore the boundary and lock-on colliders
        if (other.tag == "Boundary")
        {
            return;
        }
        if (other.tag == "Lockon")
        {
            return;
        }

        //ignore everything that was already processed as dead
        if (dead)
        {
            return;
        }

        //if something collides with the player
        if (other.tag == "Player")
        {
            //increment powerup meter if it was a powerup
            if (gameObject.tag == "Powerup")
            {
                powerupController.IncrementMeter();
                Destroy(gameObject);
            }
            //if it is not a scan box, hurt the player and destroy the other collider
            else if (!playerController.ps.invincible)
            {
                if (gameObject.GetComponentInChildren <ScanBox> () == null)
                {
                    playerController.TakeDamage();
                    Destroy(gameObject);
                }
            }
        }
        //all cases for when an enemy is attacked; hurt the respective enemy
        else
        {
            if (enemyController != null)
            {
                enemyController.TakeDamage(playerController.ps.damage);
                Destroy(other.gameObject);
            }
            else if (sideEnemyController != null)
            {
                sideEnemyController.TakeDamage(playerController.ps.damage);
                Destroy(other.gameObject);
            }
            else if (particleEnemyController != null)
            {
                particleEnemyController.TakeDamage(playerController.ps.damage);
                Destroy(other.gameObject);
            }
            else if (missileSeek != null)
            {
                missileSeek.TakeDamage(playerController.ps.damage);
                Destroy(other.gameObject);
            }
        }
    }