๐ŸฆพCharacter Rig

In this section we will set up the charcater rig.

Adding IK Objects

Add your character to the scene. Locate the root bone of the hierarchy and add the Rig Component to it:

Tip: this component contains the information about the character skeleton. It is used in runtime to re-trive the Transform bone references.

Now, go back to your character Game Object and add the FPS Animator component to it. Then, press the Initialize Component button:

This action will add the IK Objects to your character:

All IK Objects follow the same naming conveniton in the project: "IK_ObjectName", where "IK" stands for Inverse Kinematics, and "ObjectName" defines the actual name.

All IK Objects have a KVirtualElement attached to them - this component is used to dynamically copy the animation data from the real bone to the IK Object.

Example: the IK RightHand object will use the Right Hand bone as a targetBone in the Virtual Element component. This will make the IK RightHand copy the transform of the Right Hand bone in runtime, which is essential for procedural animation.

Note: if there are any issues with your skeleton, like non-standard naming convention for bones, you will see warning and error messages in the log. You will have to manually add those Game Objects, as well as Virtual Element components.

At this point, we have prepared the character skeleton. In the future, if you make any changes to the hierarchy, make sure to Refresh Hierarchy in the Rig Component. This will make the system aware of your newly added Game Objects, so you can use them in the Animator Layers.

Create Input Config

Now we need to create an UserInputConfig. Right click in any folder and go to KINEMATION/Input Config:

Input Config contains what runtime properties will be used in our system. It is essential for communication between the FPS Animation Framework entites and your custom code.

So far the Input Config supports 4 types of properties: Int, Float, Bool and Vector4.

Tip: Floats have a special interpolation feature, which allows the system to automatically interpolate the value once it's changed. This feature is useful when you want a smooth transition from one value to another.

Example: let's say you want to disable FPSAnimator upper body override. To do this, you only need to grab a reference to the IUserInputController and call the SetValue(string, object) method to set the value for "StabilizationWeight" and "PlayablesWeight".

Note: even though you can manually create an Input Config, it is recommended to use an example asset from KINEMATION/FPS Animation Framework/Assets folder. You can find out more about demo project inputs here: Input System

Create Rig Asset

Tip: On of the groundbreaking features implemented in the Scriptable Animation System is the new way of storing the information about the character skeleton - Rig Assets. They contain all the crucial information about the character, and they are used to dynamically select Rig Elements, Rig Chains and Curves in the Editor.

It is time to create a Rig Asset. Right click in any folder and go to KINEMATION/Rig.

The Rig Asset contains all the information about your character skeleton, including:

  • Hierarchy - actual hierarchy of your character.

  • Element Chains - an alternative to Avatar Masks.

  • Curves - Playables curves for dynamic animations (e.g. reloading, grenade throw, etc.)

Now we need to set the key properties:

  1. Set the Rig Component reference to your character's Rig Component.

  2. Set the Target Animator to the desired Animator Controller.

  3. Set the Input Config to the asset we created a step earlier.

Finally, click the Import Rig button. If you are making any changes to the character skeleton, always make sure to update the Rig Asset - this is crucial for the system to retrieve Transform bone references in runtime.

Add Element Chains

Element Chains is a new feautre in the FPS Animation Framework. It represents a sequence of elements (usually bones), which is used by Animator Layers in runtime. For example, if we want to attach the left hand to the weapon, we will need to add a respective Element Chain:

The main benefit of Element Chains is that it's easier to set them up, unlike Avatar Masks. Plus, you have all the chains in the Rig Asset, which makes it even more convenient.

Add Curves

Now let's go to the Curves section in our Rig Asset. By default, the list will be empty. Let's fix that by adding:

  • MaskAttachHand

  • WeaponBoneWeight

  • Overlay

These curves will be used in the Playables system for custom animations, like reloading, grenade throw or any other dynamic fire-and-forget type of animation. Here is an example from the demo project:

The character skeleton is now ready, in the next section we add Animator Profile and Layers to our system!

Last updated