void FireProjectile()
    {
        GameObject           projectileSpawnObject = gameObject.transform.Find("ProjectileSpawn").gameObject;
        ProjectileParameters projectileParams      = gunParameters.projectileParameters;

        if (projectileSpawnObject != null)
        {
            Vector3    spawn      = projectileSpawnObject.transform.position;
            GameObject projectile = Instantiate(projectileParams.GetProjectile(), spawn, Quaternion.Euler(Camera.main.transform.forward));
            projectile.transform.rotation = Quaternion.Euler(Camera.main.transform.forward);
            Rigidbody rb = projectile.gameObject.GetComponent <Rigidbody>();

            if (rb != null)
            {
                rb.AddForce(transform.forward * projectileParams.speed);
                ProjectileScript projectileScript = projectile.GetComponent <ProjectileScript>();
                if (projectileScript != null)
                {
                    projectileScript.SetParameters(projectileParams.type, projectileParams.fuse, projectileParams.detonationForce, projectileParams.radius, projectileParams.damage);
                }
                else
                {
                    Destroy(projectile);
                    Debug.Log("No projectile script attached, destroying projectile");
                }
            }
        }
    }