![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | dmonet |
I’m working through rotating a playermodels spine bone up/down based on mouse input. I originally used set_bone_custom_pose as it allowed posing after an animation played from an AnimationPlayer, but it’s no longer supported in godot 4.
I’ve tried a couple solutions online (seen below), but the axis_local is misaligned when rotating and can’t seem to get it quite right.
var spine = skeleton.find_bone("spine_02")
var bone_pose = skeleton.get_bone_global_pose(spine)
var bone_to_global = skeleton.global_transform * skeleton.get_bone_global_pose(spine);
var axis_global = Vector3.UP
var axis_local = bone_to_global.basis.transposed() * axis_global
bone_pose = bone_pose.rotated(axis_local.normalized(), rot)
skeleton.set_bone_global_pose_override(spine, bone_pose, 1, true)
Is there equivalent functionality in godot 4 for set_bone_custom_pose?