IK Manager
Last updated
Last updated
This component handles everything IK related. It uses IK Sets and IK Processors to keep all the IK modifications modular.
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.
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.
Reference for the Animator Controller Component. [Required]
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
Global IK weight for all IK Sets, this will disable completely all IK calculations if the weight is zero.
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.
Enable or Disable the IK Weight instantly (No Smooth weights)
Name of the Set. This is used to find Sets using the component IK Connector to enable or disable them
Local weight for the IK Set.
When the Set is active, this will smoothly activate it using this time value
When the Set is disabled , this will smoothly deactivate it using this time value
Some IK Procesors use a Direction vector to calculate their logic, such as Look At and Aiming. The Aimer component will give that data.
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.
This will allow the IK Set weight to turn on and of slowly. Set it to zero to change the weight instanlty.
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 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 ProcessorsIK 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.
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:
Enable Disable the Processor. Useful for debuggin porpusess.
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 or description of the IK Processor.
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 ProcessorsUse the events to add extra logic when an IK set is enable or Disabled
Invoked everytime the weight changes its value
Invoked when the Set is enabled (Weight is greaters than zero)
Invoked when the Set is zero (Weight is zero)