Um, I do not think this is a problem with the IK, yet. You need to add a
poleTargetBone option. I use my own custom skeleton, not one of MH’s. The bone I pick for pole target is always the parent of the control bone. You can also specify a
poleTargetMesh as an alternative, but I abandoned that. There is already a parent bone, so nothing to create or pose.
The next problem is you need to initially place the
targetMesh at the end of 2nd IK bone in the pair. If you then add a PointerDragBehavior, see https://www.babylonjs-playground.com/#VSURBJ#2, then you can actually pose the thing much easier. As soon as the mesh is too far away for the end of the arm to reach, it gets much more difficult to work with.
To really get full control, you also should be able to edit these properties on the controller:
- IK Pole Angle (± PI). This adjusts the location of the elbow / knee joint, and fixes weird shoulders.
- The Yaw, Pitch & Roll adjusts (± PI). These rotate the bone down from the 2nd IK bone (wrist / ankle). I had been using a look bone controller to control those.
Actually these 3 adjusts are far superior to a look controller, anyway. You can have your wrist looking at something, but not be rotated as desired in other respects. I have very tight requirements for the wrist, so I added these, and that’s when I figured out that the look controller could be ditched, but have not done that yet.
Here is my editor. I use sliders for the adjustments. You might use a gizmo for all but the pole angle instead, but I am modeling in meters for XR, and gizmos are not ideal. I do use a gizmo for my custom IK root bone controller, though. Its gizmo only shows when the root bone target mesh is the currently selected target mesh. The Selected mesh is the one with the orange highlight layer (left arm target mesh in pic). Ignore the red squares. They are look control target meshes which have not been deleted yet.
Finally, coming from blender, I also had to add the option
bendAxis: BABYLON.Vector3.Left(). Cannot remember what that fixed. Do not have the time to undo to find out. You may not need this.