> ## 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.

# 🌟Getting Set Up

> In this tutorial you will learn how to set up the plugin.

<Tip>
  **Tip**: make sure to already implement basic firing logic in your project.
</Tip>

## Step 1 - Recoil Animation Component

First, it is essential to add the **Recoil Animation Component** to the character.

<Tabs>
  <Tab title="Option">
    <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/ff6443f284de79685ae1.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=0321de91665e6159df3555638f96f681" alt="" width={419} data-path="images/pras/ff6443f284de79685ae1.png" />
  </Tab>

  <Tab title="Option">
    ```text theme={null}
    UCLASS(config=Game)
    class AYourCharacterClass : public ACharacter
    {
        GENERATED_BODY()

    public:
        AYourCharacterClass();

    protected:
        UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = "Recoil")
        TObjectPtr<URecoilAnimationComponent> RecoilComponent;

        ...
    };
    ```
  </Tab>
</Tabs>

Then, in your character class click on the RecoilAnimation component and specify the Helper UI:

<Frame caption={"Select this blueprint."}>
  <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/4d358585c8e0cbb7a181.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=7bb79375556a7144a2fe69c1ba1176fc" alt="" width={384} data-path="images/pras/4d358585c8e0cbb7a181.png" />
</Frame>

The Helper UI is useful when you want to modify the recoil values in runtime in a very convenient way:

<img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/6d7738acfb09752360d3.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=a864c3cc75d0b04e3d49edc6a8fe780f" alt="" width={533} data-path="images/pras/6d7738acfb09752360d3.png" />

To enable this Helper UI in the game you can use the Blueprint-exposed methods:

<Frame caption={"How to use helper UI."}>
  <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/85d1874facaa1863896a.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=8ef13c27afc02d97a9158e9a74ac88f9" alt="" width={485} data-path="images/pras/85d1874facaa1863896a.png" />
</Frame>

## Step 2 - Initialize and Play

Make sure to call the `Init` method of the **Recoil Animation Component** to initialize the recoil animation:

<Frame caption={"Init function."}>
  <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/5a3d4f9574ed2494249c.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=b7079cbbfd7aa24cae4ef1aed483b4c7" alt="" width={563} data-path="images/pras/5a3d4f9574ed2494249c.png" />
</Frame>

* **Data**: **Recoil Data** asset.

* **Rate**: fire rate or RPM (Rounds-per-minute).

* **Burst:** length of the burst sequence\*\*.\*\*

Next, call `Play` and `Stop` methods when firing:

<Frame caption={"Firing logic."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/pras/03ace7aecce9c74d27c8.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=de6ce3c02872ddbf034170b1a2522d25" alt="" width={491} data-path="images/pras/03ace7aecce9c74d27c8.png" />
</Frame>

<Warning>
  **Note**: Play must be called every shot!
</Warning>

## Step 3 - Animation Blueprint Integration

Make sure to add a **Recoil Animation** node to the Anim Graph:

<Frame caption={"This node will apply recoil."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/pras/173c1873e9ff49469ba4.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=c24a07677a99a1bb1a1c30b2cc090b62" alt="" width={234} data-path="images/pras/173c1873e9ff49469ba4.png" />
</Frame>

If you already have an *IK* system set up, select the *IK* or a *VB* (virtual bone) you want to animate with recoil in the node settings:

<Frame caption={"Node settings."}>
  <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/fb270a31ba51d07c8f67.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=1acd74949d2711021f20fba6f2b60307" alt="" width={431} data-path="images/pras/fb270a31ba51d07c8f67.png" />
</Frame>

### If you need help with IK

First, add Virtual Bones to the character head:

<Frame caption={"VB stands for Virtual Bone."}>
  <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/a2ba4df188b4c9d6948e.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=82862c0ef569beb8a680ad45448a0fa1" alt="" width={305} data-path="images/pras/a2ba4df188b4c9d6948e.png" />
</Frame>

* **VB WeaponPivot** targets ik\_hand\_gun.

* **VB hand\_r** targets hand\_r.

* **VB hand\_l** targets hand\_l.

Add **CopyBone** nodes before the **Recoil Animation** nodes:

<Frame caption={"These will copy animation from FK bones to VBs."}>
  <img src="https://mintcdn.com/kinemation/iFeSeTR8-9oVWKko/images/pras/94f6bd12aa68bc4338d7.png?fit=max&auto=format&n=iFeSeTR8-9oVWKko&q=85&s=dce46b429bf0c348d20ae572f7bd921d" alt="" width={563} data-path="images/pras/94f6bd12aa68bc4338d7.png" />
</Frame>

If your animations do not keyframe the **ik\_hand\_gun** bone (it is used for baking gun movement into the character animation), you will have to use **hand\_r** as a source bone in the first **CopyBone** node. You can additionally offset the **VB WeaponPivot** with a custom offset if you want more flexibility.

Finally, use **Two Bone IK** after the **Recoil Animation** node:

<Frame caption={"IK pass."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/pras/416a15d26b339432802a.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=3384fde911120441097df8ee849006df" alt="" width={524} data-path="images/pras/416a15d26b339432802a.png" />
</Frame>

<Frame caption={"Preferred IK settings."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/pras/3cdc0819a0effea7c181.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=ed5e51383c4f85b0106404a1f1273903" alt="" width={430} data-path="images/pras/3cdc0819a0effea7c181.png" />
</Frame>

***

At this point, the setup is complete. If recoil is still not playing, double-check the steps above or:

* Check if **Recoil Data** has any values.

* The correct bone is animated by the **RecoilAnimation**.

* **Play** method is called every shot.

* The **Fire Rate** is in rounds-per-minute and greater than zero.

If the problem persists, feel free to post a ticket on our [Discord](https://discord.gg/kinemation-1027338787958816860).
