Two Bone IK SkeletonModifier3D in Godot

Caleb DoiseCaleb Doise
2 min read

Daniel Holden has a great explanation of two bone IK and C-language style implementation here: https://theorangeduck.com/page/simple-two-joint

I’ve made a Godot SkeletonModifier3D implementation following his method which is available in this public GitHub repo: vbg_bone_tools_for_godot

See vbg_two_bone_ik_skeleton_modifier_3d.gd on GitHub

If you pull that project down, levels/two_bone_ik_level.tscn shows an example setup of how to use that.

Incidentally, the same project also has the following skeleton modifier examples:

  • VbgThreeToFiveFingerSkeletonModifier3D
    • Copies 3rd finger rotations to 4th and 5th fingers which is useful if you are trying to apply three finger animations to five finger models (such as the Synty animation packs)
  • VbgPlayAnimSkeletonModifier3d
    • Takes an Animation (or reference to animation in an AnimationLibrary) and applies to the skeleton without needing AnimationPlayer or AnimationTree.
  • VbgBlendSkeletonModifier3d
    • Blends an animation on top of the current pose (or another saved pose). Different weights can be applied to different parts of the bone tree.
  • VbgWalkRunSkeletonModifier3d
    • Blends a walk and run animation together. It attempts to automatically calculate native foot speed of the animation frames based on position of left toe in the animation frames. See levels/walking_level.tscn for example usage.

WARNING: The included model and walk and run animations in this repo currently are absolutely terrible. I threw them together as quickly as possible to have something I could include. It looks much better if you assign your own models and walk/run animations. I plan to circle back and improve those later on.

0
Subscribe to my newsletter

Read articles from Caleb Doise directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Caleb Doise
Caleb Doise