Rotation stops when moving

Hello there. I am trying to make a little hovertank game where I want the tank body to keep a fixed rotation and the gun to rotate. The script below works fine when the tank is stationary, but the gun cant rotate once the tank is moving. Some help would be much apprechiated.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class TankMovement : MonoBehaviour {

    public float speed;

    Rigidbody playerRigidbody;
    Vector3 movement;
    int floorMask;
    float camRayLength = 100f;
    GameObject gun;
    Rigidbody gunRigidbody;

    void Awake () 
    {
        playerRigidbody = GetComponent<Rigidbody> ();
        gun = GameObject.Find ("Gun");
        gunRigidbody = gun.GetComponent<Rigidbody> ();
        floorMask = LayerMask.GetMask ("Floor");
    }

    void FixedUpdate ()
    {
        float h = Input.GetAxisRaw ("Horizontal");
        float v = Input.GetAxisRaw ("Vertical");

        GunTurning ();

        Move (h, v);
    }


    void Move (float h, float v) 
    {
        movement.Set (h, 0f, v);
        movement = movement.normalized * speed * Time.deltaTime;
        playerRigidbody.MovePosition (playerRigidbody.position + movement);
    }

    void GunTurning ()
    {
        Ray camRay = Camera.main.ScreenPointToRay (Input.mousePosition);
        RaycastHit floorHit;
        if (Physics.Raycast (camRay, out floorHit, camRayLength, floorMask))
        {
            Vector3 playerToMouse = floorHit.point - transform.position;
            playerToMouse.y = 0f;
            Quaternion newRotation = Quaternion.LookRotation (playerToMouse);
            gunRigidbody.MoveRotation (newRotation);
        }
    }
}

I found a solution to the problem. Using localRotation on line 51 solved it.