Stretchy IK legs not working as intended

I have been trying to put together a Biped rig with stretchy IK /FK system for the legs and arms. I have been working with the node editor and these are my connections:

Left_thigh_IK_dist_loc -> locator point const to the thigh_IK_ jnt
Left_ankle_IK_dist_loc -> locator point const to the ankle_IK_jnt
L_Leg_IK_ctrl -> IK control for the left leg
L_thigh_IK -> Left thigh IK joint
L_knee_IK -> Left knee IK joint
Type of IK handle -> Rotate plane solver

Dist_Stretchy_l_leg_IK (Distance between node) -> to find the distance between the locators

Mul_Globalrelative_scale_Stretchy_IK_l_leg ( Multiply/Divide node ) :
Operation -> Multiply
Input1 -> 6.775
input2 -> 1 (Global_move.scale)

Div_Stretchy_IK_l_leg (Multiply/Divide node) :
Operation -> Divide
input1 -> Dist_Stretchy_l_leg_IK.distance ( 6.330 )
input2 -> Mul_Globalrelative_scale_Stretchy_IK_l_leg.outputx ( 6.775 )

cond_l_stretchy_leg_IK1 ( condition node ):
Operation -> Greater than or Equal
Input1 -> Dist_Stretchy_l_leg_IK.distance( 6.330)
Input2 -> Mul_Globalrelative_scale_Stretchy_IK_l_leg.outputX( 6.775 )
colorifTrueR -> Div_Stretchy_IK_l_leg.outputx ( 0.934 )

cond_l_enable_stretchy_leg_IK ( condition node ):
Operation -> Equals
First term -> L_Leg_IK_ctrl.enable ( enable is a custom boolean attribute created )
Second term -> 1
colorIf TrueR -> cond_l_stretchy_leg_IK1.outColorR

L_thigh_IK :
cond_l_enable_stretchy_leg_IK.outColorR - L_thigh_IK.scaleX
L_knee_IK:
cond_l_enable_stretchy_leg_IK.outColorR - L_knee_IK.scaleX

6.330 -> default distance without any IK movement
6.775 -> start point for the stretch

The result of this is something weird. The scale values of the joints change as per the stretch increase but the entire system sort of recoils back to its original position only increasing in size…

Can someone help me with this :slight_smile: Would really appreciate it… Thanks in advance and here is the Gif of the error:

ezgif-2-045c9941c6

I think it’s because of the cycle. Don’t know why it is not highlighted.
Locators are constrained to joints. And joints’ scale are driven by locators.

Hi rigy… Thanks for your reply. Only the locator mapped to the thigh IK joint is point constrained to it. The other locator is constrained to the ankle ik control. I tried putting the constraints different it is not working… Any alternate solutions to find distance between joints ???

Thanks for this advice :slight_smile:

Hi, I’m not sure if you have already solved the issue, but I feel that you have placed a wrong default distance for your stretch.

Cause right now the length that you have placed in your condition node is the length between your thigh and your ankle. But the length that you need to put in is the combined length of your joints, so the length of your thigh to knee plus the length of the knee to ankle.

Just want to chime in.

@yike
“But the length that you need to put in is the combined length of your joints, so the length of your thigh to knee plus the length of the knee to ankle.”

This is not necessary mate. You can have a working stretchy IK chain for both scenarios
(i.e. Scenario 1. Thigh to Ankle and Scenario 2. Thigh to Knee and Knee to Ankle).

Regarding the cycle error, be sure NOT TO CONSTRAINT the locator to any joint.
So if you are going for Scenario 1, it should be THIGH_GRP (not thigh joint) and the FOOT CON (not ankle joint)