Inverse kinematics of the legs
To configure the inverse kinematics for the legs, we need the Foot IK component:
Here are two parameters that should be described in the animation controller.
Left Foot IK Weight
The weight of the left leg.
Right Foot IK Weight
The weight of the right leg.
Weight - how much we will redefine the position, relative to the animation.
The higher this value is, the stronger we bind the position of the bone to some other position.
Next, we need to go to the animation we need and open the Curves item and create two curves for our variables there :
The values of each variable range from 0 to 1.
0 - the position depends entirely on the animation. 1 - it will depend on the surface under the foot.
The value is equal to 1
The value is equal to 0
The surface is checked by throwing the beam from the patch down.
Let's consider the curves of inverse kinematics on the example of walking:
At the moment when the foot leaves the floor, the curve gradually changes to the value 0, and when it begins to descend to the surface, it gradually changes to the value 1.
The values should not be left statically equal to 1, because of this, it may turn out that your character will start, as it were, sliding on the surface, and not walking on it.