Can't set bone rotation

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By 1Snakel
:warning: Old Version Published before Godot 3 was released.

Hi! I’ve a problem setting the bone rotation.

i’m doing this:

   skeleton = get_node("Spatial/Armature/Skeleton")
head = skeleton.find_bone("hips")
head_transform = skeleton.get_bone_rest(head)
head_transform.rotated(Vector3(1, 0, 0), deg2rad(cam_pitch))
skeleton.set_bone_pose( head, head_transform )

it doesn’t work at all.

:bust_in_silhouette: Reply From: IKRadulov

You forgot to assign head_transform.rotated(Vector3(1, 0, 0), deg2rad(cam_pitch)) to the variable you are passing to skeleton.set_bone_pose() .

Basicly you have to assign the viriable or it wont be changed .
head_transform = head_transform.rotated(Vector3(1, 0, 0), deg2rad(cam_pitch))