IK Legs (2025-11-09)

After cheking some IK videos such as these ones:
Video by Gwizz: Godot 4 Inverse Kinematics
Video by JDDoesDev: Godot 4 Tutorials: Ivnerse Kinematics in 2D | Part 1 - The Rig
Crigz Vs Game DevNEWW Procedural Animation in Godot 4.0

All of these videos are great, but they are outdated. Mainly because in these tutorials, they use SkeletonIK3D , which is a deprecated node in Godot 4.5 (which I am currently using for my projects). So their videos are useless, unless I use their exact version. How to do this in Godot4.5?

I had no idea until I saw this video by Lukky Showcasing the Brand New Noed in Godot!
In around 4:53, he shows and example with hands on how to do the IK. In the comments I noticed people saying that he should've named the video properly, because this is what people needed from the SkeletonIK3D.
To keep it short, I will not explain exactly how it works, I will just show how I did it in my prototyping. For better understanding how the IK works, check Lukkys viedo, because he breaks it down perfectly

Let's begin!

Model preparation

  • Create a model
  • Legs models

  • Add an armature and assign to it. Make sure you name your legs properly with .L at the end of the bones, it will be easier to weight paint or group select.
  • Legs naming

    Legs with armature

    I am leaving this up to you how to do it and what model to use it. All you need is to make an armature here In this case, it will be blocky/mech legs

  • Select everything and export to GLTF
  • How to export

    Godot setup

  • This is how the hierarchy looks like. To put it simply:
    • 1. Make this model local so then you can all nodes to it
      2. Add a LookAtModifier3D under Skeleton3D
      3. Create a target at which the bone will look (MeshInstance or Node3D or Transform).
      4. In LookAtModifier3D that you added. Attach the target, set the bone which will be controlled, play with settings.
      5. Add a raycast that detects the surface and make the target stick to it
    NodesStructure

  • Add LookAtModifier under Skeleton3D
  • Create targets that the bone will look at
  • I recommend making them MeshInstance because it is easier to control and to see where what is. In my case, I chose them to be red spheres.
    Make sure the naming is similar to the bone that is controlling

  • In the LookAtModfier, select the target that you created, add the bone that it will effect (this is where naming becomes really important)
  • NodesStructure

    Play around with Forward Axis, Primary Rotation Axis and Use Secondary Rotation. These settings will determine how it affects the leg.

  • After creating all the bone moddifiers (in this case it is UpperLegModifier, LowerLegModifier). These 2 modifiers controls whole leg.
    Therefore, you need one point to control them all. As shown in the first screenshot in this section you see there is light blue squeres. Behind the foot there is other ones.
    Basically, create a point from which you will control all 2 points. I recommend to make that point as close to the foot. The other square or sphere will be for the foot.
  • NodesStructure
  • After creating the points that control the leg and the foot, add the targets under these control points.
  • NodesStructure
  • Add a RayCast 3D to the main Node, NOT the modifiers NOT the sekeleton and point it to the ground. Make it longer. And make the collision be in layer 2
  • NodesStructure

    Add the raycast that is pointing directly under the foot and a raycast the is in front of the foot. One controls the leg, other controls the foot.

  • Attach script to all the raycasts and write this small script
  • NodesStructure
  • And it is done.
  • NodesStructure

    As shown, the right leg raises up and bends it's knee, also tilting the foot appropriately. Mess around with the settings, add more features to your liking. I just recreated what I needed.

    Bonus

    This is just details and bonus information that you might need in my opinion:

      1. If the foot or leg does not react, make sure the grounds layer also is in Layer 2.
      2. If the foot or leg is not reacting, make sure the array is in good enough height. It cannot be on the same height as the sphere/square target
      3. If you want something with 2D and maybe IK, the I highly recommend these tutorials
  • Smitner: Procedural Pixel Art Tentacles in 6min
  • Joshulties: 2D Sprite Stacked Character Tutorial | Godot v3.5.1