Inverse Kinematics (IK)

Inverse Kinematics(IK) is the process of adjusting the character’s bones after the animation frame has completed.IK is extremely useful to position the feet so they are always on the ground, rotating the upper body so the character always looks at the crosshairs, and positioning the hands so they are properly holding the item.The CharacterIK component included with the Ultimate Character Controller uses Unity’s IK solution which only works on humanoid rigs.This means that the CharacterIK component will not work with your first person arms because it is a generic rig.

Inspected Fields

Base Layer Index

The index of the base layer within the Animator Controller.

Upper Body Layer Index

The index of the upper body layer within the Animator Controller.

Debug Draw Look Ray

Draw a debug line to see the direction that the character is facing (editor only). When this field is enabled you’ll see a green line similar to the image below.

Layer Mask

The layers that the component should use when determining the objects to test against. This mask allows the IK component to ignore invisible layers and is useful for stairs.For example, at design time you may place an invisible plane to act as the slope so the character smoothly moves up the stairs. IK shouldn’t position the character’s feet on this invisible plane, rather the feet should be positioned directly on the stairs. By using the Layer Mask field you can limit what objects the IK component detects.

Look At Offset

Any offset to apply to the look at direction for the body and arms. The offset allows the character to adjust look direction without the camera actually changing angle.The left image below has an offset of (0, 0, 0) and the right image has an offset of (0.5, 0, 0).

Look at Body Weight

Determines how much weight is applied to the body when looking at the target.A value of 0 indicates that the body should not look at the target while a value of 1 indicates the maximum amount of weight should be applied.

Look at Head Weight

Determines how much weight is applied to the head when looking at the target.A value of 0 indicates that the head should not look at the target while a value of 1 indicates the maximum amount of weight should be applied. The screenshots below show increasing weight values for the body and head look at weight.

Look at Eyes Weight

Determines how much weight is applied to the eyes when looking at the target.A value of 0 indicates that the eyes should not look at the target while a value of 1 indicates the maximum amount of weight should be applied.

Look at Clamp Weight

A value of 0 means the character is completely unrestrained in motion, 1 means the character motion completely clamped (look at becomes impossible) (0-1).

Look at Adjustment Speed

The adjustment speed to apply to the Look At position.

Active Look At State Name

The name of the state when the character is actively looking at a target.

Look At Weight Adjustment Speed

The speed at which the look at weight should adjust.

Hips Position Adjustment Speed

The speed at which the hips position should adjust between using IK and not using IK. The hips will change position when the character is standing on uneven ground.As an example, imagine that the character is standing on a set of stairs. The stairs have two sets of colliders: one collider which covers each step and another plane collider at the same slope as the stairs. The character’s collider is going to be resting on the plane collider while standing on the stairs and the IK system will be trying to ensure the feet are resting on the stairs collider.In some cases the plane collider may be relatively far above the stair collider so the hip needs to be moved down to allow the character’s foot to hit the stair collider.

Foot Offset Adjustment

The offset of the foot between the foot bone and the base of the foot. This value should be increased if the bottom of your character’s foot is intersecting with the ground.

Foot Weight Active Adjustment Speed

The speed at which the foot weight should adjust to when foot IK is active.

Foot Weight Inactive Adjustment Speed

The speed at which the foot weight should adjust to when foot IK is inactive.

Override Foot IK Weight

The overridden weight for foot IK. Set to -1 to disable.

Upper Arm Weight

Determines how much weight is applied to the upper arms when looking at the target.A value of 0 indicates that the upper arms should not look at the target while a value of 1 indicates the maximum amount of weight should be applied. In the left screenshot below the upper arm weight has a value of 0 and the right screenshot has a value of 1.

Upper Arm Adjustment Speed

The speed at which the upper arm rotation should adjust to using IK and not using IK.

Hand Weight

Determines how much weight is applied to the hands when looking at the target.A value of 0 indicates that the hands should not look at the target while a value of 1 indicates the maximum amount of weight should be applied. In the left screenshot below the weight has a value of 0 and the right screenshot has a weight of 1. The upper arms have a weight of 0 in this screenshot which is why the left hand in the image on the right isn’t positioned correctly.

Hand Adjustment Speed

The speed at which the hand position/rotation should adjust to using IK and not using IK.

Hand Position Offset

Specifies a local offset to add to the position of the hands.

Left Hand Position Spring

The left hand positional spring used for IK movement. This can be used for adding positional effects such as recoil.

Left Hand Rotation Spring

The left hand rotational spring used for IK movement. This can be used for adding rotational effects such as recoil.

Right Hand Position Spring

The right hand positional spring used for IK movement. This can be used for adding positional effects such as recoil.

Right Hand Rotation Spring

The right hand rotational spring used for IK movement. This can be used for adding rotational effects such as recoil.