IK Manager

Overview

This component handles everything IK related. It uses IK Sets and IK Processors to keep all the IK modifications modular.

How it works

Let's say you need IK to fix the positions of the hands and spine when carrying a box, or you need to fix the Hands when carrying a rifle, or place the hands properly when climbing a wall. First, you will need to create a new IK Set. Inside this new IK Set, we will add IK Processors that will handle the corrections of the bones needed. These processors calculate all the Inverse and/or Forward Kinematic steps to get a proper final result. Finally, you will set the filters and weights from when you want that IK set to be active.

Requirements

  • It requires a reference for the Animator Controller the character is using. Make sure the reference is set properly.

  • Each IK Processor from the set may require an external Target as a Transform to work. if the Transform does not exist, the IK Processor will be ignored.

  • The activation of each IK Set is done using the component: IK Connector. That will send to the character what IK Set to activate or deactivate. This component also can give external data to the IK Mangaer like Transform Targets.

Parameters

Animator

Reference for the Animator Controller Component. [Required]

Use Update 0

When an Animator controller uses AnimatePhysics, IK calculations cause jittering in the bones. Calling Animator.Update(0) solves the issue, but it creates an extra cycle on the animator. Use it cautiously

Weight (Global Weight)

Global IK weight for all IK Sets, this will disable completely all IK calculations if the weight is zero.


IK Sets

Each IK Set represents a IK configuration for a certain mechanic on your controller. E.g. you can have an IK set for carrying a box, another for when you are using two-handed weapons, and another when the character is Aiming with a bow.

Active

Enable or Disable the IK Weight instantly (No Smooth weights)

IK Set Name

Name of the Set. This is used to find Sets using the component IK Connector to enable or disable them

Weight

Local weight for the IK Set.

Enable Time

When the Set is active, this will smoothly activate it using this time value

Disable Time

When the Set is disabled , this will smoothly deactivate it using this time value

Aimer

Some IK Procesors use a Direction vector to calculate their logic, such as Look At and Aiming. The Aimer component will give that data.

Filter by State and Filter by Stances

When the IK Set is active it will check if the character is on any of these states or stances. This will automatically turn the Set on or off temporarliy if a state or stance not included in the list gets activated.

E.g. While the Bow is being aimed and the character enters the water, the IK will be off temporarlily until the character goes back to locomotion.


Lerp Weight

This will allow the IK Set weight to turn on and of slowly. Set it to zero to change the weight instanlty.

Targets

Some IK processors require an external target. These will be stored at runtime here. Use the IK Connector Component set these parameters from external sources

IK Weights

IK weights are a modular way to change the IK Set weight value. Allowing to set the weight to zero by an animation Curve or restrict the weight using a Look Direction.

For more details on each available weigth processors so far check

Weight Processors

IK Processors

IK processors holds all the logic for all the IK calculations. Most of the available processors are meant to be used for Humanoid Rigs using Unity Human IK System.

Verify

This check all the processors initial values. Checks if there's a correct target index

It will sent a Console Log to see if some changes are needed:

Active

Enable Disable the Processor. Useful for debuggin porpusess.

Target Index

Index of the Array of targets the IK procesor Requires. If the IK processor does not need any Target, set this value to -1

Name

Name or description of the IK Processor.

Weight

Weight of the processor. This is multiplied by the IK Set Processor at the end

To check how each avaiable procesor works please check this page:

IK Processors

Events

Use the events to add extra logic when an IK set is enable or Disabled

On Weight Changed

Invoked everytime the weight changes its value

On Set Enable

Invoked when the Set is enabled (Weight is greaters than zero)

On Set Disable

Invoked when the Set is zero (Weight is zero)

Last updated