Hot to rotate bone in script only on x axis

Godot Version

4.1.3 Stable

Question

Hello everyone,
Im trying to make an 3D fps controller and my idea is to rotate whole body on y axis when mouse is moving on the horizontal and rotate head with neck on the x axis so that is doesnt clip to the camera.
I already have camera and body rotation

func _unhandled_input(event):
if event is InputEventMouseMotion:
self.rotate_y(-event.relative.x * SENSITIVITY)
Camera.rotate_x(-event.relative.y * SENSITIVITY)
Camera.rotation.x = clamp(Camera.rotation.x, deg_to_rad(-40), deg_to_rad(60))

now i just need to rotate lets say the neck bone how do i rotate it only on x axis?
i know how to reference it using godot online documentation but i have only came up with this

var Trans = Skel.get_bone_pose(HeadBone)
Trans.rotated(Vector3(-event.relative.y * SENSITIVITY, 0, 0), 0.1)|

but nothing happens i would appreciate help thank you

If it’s FPS, then you likely don’t need a head at all. Have the camera (the head) in one node and the body in another. That way you can better control stuff.

hth