I needed IK. People said IK was hard. I did it anyway.
This project provides three classes:
-
GodotIK
ASkeletonModifier
that does all the magic. -
GodotIKEffector
Parented byGodotIK
in the SceneTree, these nodes position the bones, define the chain length, and rotate the affected bone according to theirtransform_behavior
property. -
GodotIKConstraint
An abstract class that is parented byGodotIKEffector
s. Two examples are provided as GDScript implementations:PoleConstraint
andStraightBoneConstraint
.
This is the best implementation I could come up with. It's stable—at least as stable as it gets with constraints.
For further reference, check out the doc_classes/
directory; it tells it all.
SceneTree example: Skeleton3D -> GodotIK -> [GodotIKEffectors] -> GodotIKConstraint
demo_libik.webm
(Video sometimes doesn't load. Refreshing page often helps.)
We have binaries!
- Download release https://github.com/monxa/GodotIK/releases
- Unpack and copy /addons into <your-project-path>
- git clone
- git submodule init # for godot-cpp
- git submodule update # for godot-cpp
- scons # compile
- cp -r godot_project/addons/libik <your-project-path>/addons
If you recently unsuccessfully cloned or tried to build the repository, it was probably because the godot-cpp submodule was configured to use the SSH origin, which you needed to set up. We have now switched to the HTTPS origin. To fix this, run git submodule sync followed by git submodule update.