Look script not working

I’m making an FPS but my Look Script only rotates on 1 axis this is the script

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

public class PlayerLookScript : MonoBehaviour
{

    public float mouseSens = 100f;
    public Transform playerBody;
    public float xRotation = 0f;

    void Start() 
    {
        Cursor.lockState = CursorLockMode.Locked;
    }

    void Update()
    {
        float mouseX = Input.GetAxis("Mouse X") * mouseSens * Time.deltaTime;
        float mouseY = Input.GetAxis("Mouse Y") * mouseSens * Time.deltaTime;

        xRotation -= mouseY;
        xRotation = Mathf.Clamp(xRotation, -90f, 90f);

        transform.localRotation = Quaternion.Euler(xRotation, 0f, 0f);
        playerBody.Rotate(Vector3.up * mouseX);
    }
}

Might be easier to break apart your player prefab so you have a root object, then parented pivot objects below it.

5387907--546333--Screen Shot 2020-01-19 at 1.37.53 PM.png

This way you can drive each axis (up/down rotate in X, left/righr rotate in Y) with separate transform.localRotation settings, tracking X tilt and Y heading in separate floats.