IK in custom Animations
Game Creator makes it very easy to correctly align a Character's feet on uneven terrain. All that you have to do is tell, per animation clip, which frames should Game Creator consider being grounded and which not.

For example, for the Idle animation, both feet should be considered to be on the ground at all times. However, when Running, the character right foot elevates while the left one touches the ground, and vice-versa.
This is really easy to set up. All you need to do is select your imported animation clip and bring up the Animation tab in the inspector.
Let's see how to configure the Idle animation first. Let's select the animation clip from the Project Panel.

Idle Animation
We'll ignore those warnings for now and focus on the animation clip. Make sure you select the "Idle_Hum" clip and scroll further down, up until you see the Curves section.

Click on the (+) sign and create a couple of curves. Give each one of them the name IK_leftFoot and IK_rightFoot. It is very important that you name these with the correct capital letters!
Click on the curve graph and edit the values so both ends. By default the value is set to 0 but we need to change it to 1.
If we click play, we'll see how, on steep terrain, the player correctly aligns its feet with the ground while being on idle. But what happens if we approach the Running animation like the Idle? It will drag their feet on the ground, without elevating them.
Running/Walking Animation
So, to solve this, the Walking and Running animations need a bit more work. We need to synchronize the frames that each feet are touching the ground with the ones that are not.
To do so, we scrub over the timeline and select which frames are the feet in contact with the ground and create a key in the Curve graph. For example, the run animation for the PBR Soldier would look something like this.

The best results are obtained from experimenting. We've discovered that precision is not that important. What yields the best results is having smooth gradients.
Last updated
Was this helpful?