> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kinemation.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# 🦾Procedural

> In this section you will learn about IK used in the Tactical Shooter Pack.

## Tac Procedural Animation

This component is responsible for all procedural animation features in the pack, specifically:

* **Weapon sway**

* **Aiming**

* **Weapon and hands positioning**

* **Movement animations and recoil**

* **Spine rotation**

* **Pistol quick draw mechanic**

<Frame caption={"Procedural component."}>
  <img src="https://mintcdn.com/kinemation/-AzWoLR_QWINVM-e/images/tactical-shooter-pack/unity/9e13fcd7cba4077ff60e.png?fit=max&auto=format&n=-AzWoLR_QWINVM-e&q=85&s=02248eb345c65a95083f423bc2f0d333" alt="" width={379} data-path="images/tactical-shooter-pack/unity/9e13fcd7cba4077ff60e.png" />
</Frame>

* **Aiming Weight**: influence procedural aiming; if set to 1 - aiming will be fully applied, 0 - disabled completely.

* **Pitch Input**: look up angle.

* **Yaw Input**: look right/left angle.

The **Bones** struct contains references to skeleton bone transforms:

<Frame caption={"Skeleton bones."}>
  <img src="https://mintcdn.com/kinemation/-AzWoLR_QWINVM-e/images/tactical-shooter-pack/unity/d7578b2031d1de791b34.png?fit=max&auto=format&n=-AzWoLR_QWINVM-e&q=85&s=57b2bb2056ecbd1f1272aa38d2075743" alt="" width={363} data-path="images/tactical-shooter-pack/unity/d7578b2031d1de791b34.png" />
</Frame>

* **Look Up/Right Bones**: contains spine bones to look up/right.

## How to use it in code

The integration process involves updating input values of this component. We will use the **TacticalShooterPlayer** script as an example.

### Initialization

Add a new field of the `TacticalProceduralAnimation` type, and then initialize it on Start. The component does not require manual initialization, as it handles it under the hood.

### Aiming

To make procedural aiming work, it's essential to update `aimingWeight` and `aimPoint`:

The `aimingWeight` is a value in range \[0;1], make sure to smoothly interpolate it to 1 when aiming, and to zero when not.

It's also important to provide the `aimTransform` - a KTransform (position & rotation) pose that represents aim point relative to the weapon transform. Here's an example of how this value is computed in the pack:

### Equipping a new weapon

**TacticalProceduralAnimation** component uses **TacticalWeaponSettings** (a Scriptable Object) as a data source. It is important to update these settings when a new weapon is equipped:

### Updating Inputs

To make the player look around and sway the weapon, make sure to update aim and move inputs:

### Pistol quick draw mechanic

In **Tactical Shooter Pack**, you can quick-draw a sideram while holding a rifle. The mechanic relies on the pistol (siderarm) pose relative to the right hand. To update such a pose, it's important to use this method:

The `gunRightHandPose` field is a part of the **TacticalShooterWeapon** component:

When the game starts, every weapon will sample a base idle pose to compute the weapon pose relative to the right hand.

### Playing IK Motions

**IK Motion** is a feature that allows you to play custom additive IK motions at runtime:

<Frame caption={"IK Motion example"}>
  <img src="https://mintcdn.com/kinemation/-AzWoLR_QWINVM-e/images/tactical-shooter-pack/unity/c847270630f246292a76.png?fit=max&auto=format&n=-AzWoLR_QWINVM-e&q=85&s=205307889feaf417a97701cbe886b569" alt="" width={392} data-path="images/tactical-shooter-pack/unity/c847270630f246292a76.png" />
</Frame>

* **Rotation**/**Translation Curves**: define motion for each translation and rotation axes.

* **Rotation**/**Translation Scale**: multipliers for each translation and rotation axes.

* **Blend Time**: blending in time in seconds.

* **Play Rate**: playback multiplier.

<Tip>
  **Tip**: This feature is used for additive transitions when aiming or changing a fire mode.
</Tip>
