Bone rotation in LateUpdate goes back to normal every frame

Hi everyone!
I’d like to rotate a bone of a character following the mouseX Input. But the bone slowly goes back to its original position every frame, I’d like it to stay where it was rotated.

The character has a NavMesh moving him in like a cinematic scene where we can move the head.

Here’s the code

    void Update()
    {
           rotX = Input.GetAxis("Mouse X") * sensitivity;
           (...)
    }    
    void LateUpdate()
    {
        //headRot is a float, head is the bone's transform
        headRot = head.transform.rotation.y+rotX;
        head.transform.localRotation = Quaternion.AngleAxis(headRot, new Vector3 (0,1,0));
    }

I guess, the problem is this code line headRot = head.transform.rotation.y+rotX; You use transform.rotation, the result is a Quaternion, but you want the eulerAngles and so you have to write headRot = transform.localEulerAngles.y + rotX;

Ok got it! It’s stupid as F.

Before :

     void LateUpdate()
     {
         //headRot is a float, head is the bone's transform
         headRot = head.transform.localEulerAngles.y + rotX;;
         head.transform.localRotation = Quaternion.AngleAxis(headRot, new Vector3 (0,1,0));
     }

headRot is here taking the rotation as it is after the Update() function, which is the reset value of the default animation! Which is F-ing zero… So I just put that line after the last one in LateUpdate, so it takes the actual modified value. And works perfectly.

    void LateUpdate()
    {
        
        head.transform.localRotation = Quaternion.AngleAxis(headRot+rotX, new Vector3 (0,1,0));
        headRot = head.transform.localEulerAngles.y;
    }

Since I can’t reward myself on the forum, I’ll reward myself with a cookie. Cheers.