# Layers setup

## General tips

You can add and remove layers by using "+" and "-" buttons in the Layers tab. You can also copy/paste layers by clicking on the header:

<figure><img src="/files/O3lyMNFU8CfD9zdhbkm5" alt="" width="404"><figcaption><p>You can copy layers from the demo prefabs.</p></figcaption></figure>

In this tutorial, we will add all the basic animation layers:

[#left-hand-ik](#left-hand-ik "mention")

[#a-ds-layer](#a-ds-layer "mention")

[#recoil-slot-layer](#recoil-slot-layer "mention")

[#sway-layer](#sway-layer "mention")

[#locomotion-layer](#locomotion-layer "mention")

[#look-layer](#look-layer "mention")

[#weapon-collision](#weapon-collision "mention")

## Left Hand IK

First, you need to create an Avatar Mask, which will include the left hand only. This mask will be used to manually override fingers' rotation in runtime:

<figure><img src="/files/yCR4i5sWw8gKesgSBoKK" alt="" width="374"><figcaption><p>Left Hand IK mask.</p></figcaption></figure>

Now add a **Left Hand IK Layer** to the FPSAnimator:

<figure><img src="/files/A3cs60V0LYl6pV7sE9n0" alt="" width="361"><figcaption><p>Left Hand IK Layer.</p></figcaption></figure>

Set the **Curve Name** to MaskLeftHandIK - this is a float parameter from the Animator Controller, which is used to disable the Left Hand IK via a curve. You can add a MaskLeftHandIK curve to your animation, like sprinting, and it will smoothly blend out the Left Hand IK Layer.

Set the **Mask Curve Name** to MaskLeftHand - the same as MaskLeftHandIK, but it will be used with dynamic animations, like reloads, grenade throws, etc.

Set the **Left Hand Mask** to the Avatar Mask we just created.

## Ads layer

Add the AdsLayer to the FPSAnimator and set these properties:

<figure><img src="/files/zzaI3SddnsZvA46IXBIE" alt="" width="367"><figcaption><p>Ads Layer.</p></figcaption></figure>

Set the **Aim Target** to the FPCameraSocket we created earlier. The aim target will be used to align the weapon Aim Point.

Set the **Crouch Pose Curve** to the CrouchWeight. This curve will blend it the crouch offset when crouching.

## Recoil, Slot layer

Add Recoil and Slot layers to the FPSAnimator. The Recoil layer will extract recoil from the **RecoilAnimation** component we added in the beginning, and Slot layer will apply IK transition motions. They are used when crouching, jumping and aiming.

These layers do not require any setup, so let's just go to the next layer.

## Sway layer

Add the **Sway Layer** and make sure to specify the head bone. It will be used for dead-zone or free aiming feature:

<figure><img src="/files/lTKxG6hM7ibpN8NQnBd2" alt="" width="365"><figcaption><p>Specify the head bone.</p></figcaption></figure>

This layer will apply movement and aiming sway, as well as free aiming feature.

## Locomotion layer

Add the Locomotion layer. This layer controls the animation blending, and also applies procedural curve animations:

<figure><img src="/files/jbUXuI3PWA6Yns5zmecQ" alt="" width="369"><figcaption></figcaption></figure>

Set the **Curve Name** to FullBodyWeight - this will make sure the full body is overidden by the animator only, which is useful when you want to play sprinting for example.

Set the I**k Interpolation** to 25 or any other value - this will define the smoothing speed for all curve animations (idle, walking, equip, unequip, etc.).

## Look layer

Add the Look layer to the FPSAnimator:

<figure><img src="/files/VVPvoizGLCzGvkPP1k6H" alt="" width="365"><figcaption></figcaption></figure>

Make sure to set the **LerpSpeed** and **Pelvis Lerp Speed** to some values - this will ensure smooth transitions. Also, set the **Layer Alpha** to 1.

Also set the **Lean Amount** and **Lean Speed** properties in the Leaning tab:

<figure><img src="/files/CC9zUEAF5VFpf9yN2XEo" alt="" width="365"><figcaption><p>Leaning properties.</p></figcaption></figure>

Now we need to create an **Aim Offset Table** for your character - a Scriptable Object, which contains bone indices and angles:

<figure><img src="/files/v1HMZRMi6OiLHutZXEPb" alt="" width="370"><figcaption><p>Aim Offset Table.</p></figcaption></figure>

To create a new **Aim Offset Table**, follow these steps:

1. Enable Auto Distribution.
2. Add bones to the Look Up/Right Offset lists.
3. Adjust the bone angles.
4. Click the Play button to preview the animation in the editor.
5. Adjust Aim Up/Right slider values to see how the look layer rotates the bones.
6. Finally, hit the Save Table button to generate/save exisiting asset.

<figure><img src="/files/L8MH9wqHNaqzBdtxI1Zw" alt="" width="419"><figcaption><p>Look layer setup.</p></figcaption></figure>

## Weapon Collision

This is the last layer we will add, you only need to specify the Layer Mask, which will be used for the raycast:

<figure><img src="/files/VGv1PJu47yQUjwLENFlM" alt="" width="398"><figcaption><p>Select the layer mask.</p></figcaption></figure>

At this point, we've comleted the animation layers setup, and in the next chapting we will set up our player controller.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kinemation.gitbook.io/fps-animation-framework/tutorial/getting-started/layers-setup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
