Shoot at Mouse Cursor

Could someone please help me? I have this code and im not sure why it wont work.

public float BulletSpeed;
public float Damage;

// Use this for initialization
void Start () {
    var playerPlane = new Plane(Vector3.back, transform.position);
    var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
    var hitdist = 0.0f;

    if (playerPlane.Raycast (ray,out hitdist)) {
        var targetPoint = ray.GetPoint(hitdist);
        var targetRotation = Quaternion.LookRotation(targetPoint - transform.position);
        targetRotation.x = 0.0f;
        targetRotation.y = 0.0f;
        transform.rotation = Quaternion.Slerp(transform.rotation, targetRotation, 500 * Time.deltaTime);

// Update is called once per frame
void Update () {
    transform.localPosition += (transform.TransformDirection(Vector3.left * BulletSpeed));

I believe it takes the rotation of the bullet and changes to where the mouse cursor is at then it shoots, but it can only shoot on the left side correctly (Probably due to the Vector.left).

I want it to shoot straight when its rotated correctly, Like when the bullet rotation is 90 degrees it will shoot straight at 90 degrees according to where the mouse cursor is at.

You shouldn’t manipulate a quaternions value like that (.x = 0). Try the Euler function if you want to set axes to 0.