Inverse Kinematics
Inverse Kinematics (IK) is important in game programming. It is typically used to make the character's movement more realistic. One of the main uses of IK is the calculation of the player's feet and how they relate to the ground they are standing on.
In short, IK is used to determine the position and rotation of the joints of a character based on a given position in space. For instance, to make sure the foot of a player lands properly on the terrain it is walking on.
Unity has a built-in IK system that can be used to do some basic calculations in this regard. Let's go ahead and implement the foot IK for our character. There are a few things that you will need to set up before we can enable IK for our humanoid character.
The first thing to do is check your layer in the Animator Controller
and use the Engine
icon to enter the Settings
window. Make sure that IK Pass
is checked, as shown in the following screenshot. You will also need to provide a Mask if you have not done so...