> For the complete documentation index, see [llms.txt](https://hitmans-store.gitbook.io/pras-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hitmans-store.gitbook.io/pras-documentation/tutorial/getting-set-up/animation-blueprint.md).

# Animation Blueprint

In this section you will find out how to set up the animation blueprint

## Step 1 - Add Virtual Bones

To get the system working, you need to set up the IK system. The idea is simple - hands IK targes are parented to the WeaponPivot bone, which is modified by the recoil. As a result, arms will be animated.

The bone hierarchy is the following:

* **VB WeaponPivot -> targets head bone**
  * **VB hand\_r -> targets right hand**
  * **VB hand\_l -> targets left hand**

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2F2LNy7FjslRBgpBWcW6Ue%2Fimage.png?alt=media&amp;token=ca443464-13c0-4560-bff5-a15da2fb425f" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
**Tip:** make sure that the head/neck bone is **not** scaled! This might happen when you "hide" the head mesh by using the *SkeletalMeshComponent* function **HideBoneByName** - it will reduce the scale of the bone, which will lead to incorrect results!

**Solution A:** parent the VB WeaponPivot and its children to the root bone.

**Solution B:** if you need to hide the head bone, try using an invisible material for it.
{% endhint %}

## Step 2 - Retarget Bones

Add these nodes at the end of your animation blueprint:

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2Fc7BonA7y7OZCm4GPng0d%2Fimage.png?alt=media&amp;token=8636021e-f920-4e9e-9dec-3696e7f2e658" alt="" width="464"><figcaption></figcaption></figure>

**Node settings:**

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2FzE87i9X0sSTKThYSz2lb%2Fimage.png?alt=media&amp;token=b00808ac-0db4-4195-91df-11f37f8dd3bc" alt="" width="356"><figcaption><p>Example</p></figcaption></figure>

For **VB WeaponPivot** select the *hand\_r* as a **Source bone**, we will fix it later so it's aligned with the weapon's physical pivot.

## Step 3 - Add Recoil Node

Now you need to add the RecoilAnimation node after the retargeting nodes:

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2FX5X4C9JXYuBFkRmdhRQo%2Fimage.png?alt=media&amp;token=248ea54e-cc8e-4be1-a90e-f44f87f737fb" alt="" width="450"><figcaption><p>This node will automatically apply recoil</p></figcaption></figure>

**Node settings:**

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2FK0axIj7YnD8lkGSHFI8d%2Fimage.png?alt=media&amp;token=5a952abd-5607-48bf-b9ad-e6ec6e31c3f2" alt="" width="374"><figcaption></figcaption></figure>

* **Bone to Modify** - bone to be modified by recoil.
* **Axes Order** - defines how recoil axes will be applied. By default, the recoil uses XYZ order.
* **Translation/Rotation Scale** - multipliers for each rotation/translation axis.
* **Translation/Rotation Space** - similar to Transform Modify Bone.
* **Translation/Rotation** - recoil values. Only used when *Use Auto Update* is **false**.

Select the *VB WeaponPivot*, *Component Space*, and *YXZ* order.

<details>

<summary>Why YXZ order?</summary>

If you use Epic Skeleton, then in Component Space Y is the forward, X is the right, and Z is the up axis - this is different from the standard XYZ order, so recoil won't be applied correctly.

</details>

## Step 4 - Add IK Nodes

For IK you can use FABRIK or Two Bone IK nodes - there's no a big difference. Let's use Two Bone IK in this example:

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2FswJfimUUc07j4kSuBrQO%2Fimage.png?alt=media&amp;token=0f0f252f-95ce-4da3-96cf-137490529a99" alt="" width="460"><figcaption><p>Add these nodes after the Recoil node</p></figcaption></figure>

Select **hand\_r** as an IKBone, and **VB hand\_r** as an Effector Target:

<figure><img src="https://2362259812-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4gr144sikDQaVKyIhHfL%2Fuploads%2FeKDQfHqLnmd5lyUXgifC%2Fimage.png?alt=media&amp;token=8d5b164a-5c09-49c9-bb9c-a44a98e21b68" alt="" width="378"><figcaption><p>IK node settings</p></figcaption></figure>

At this point the animation setup is complete - now it's time to find out more about curves and how recoil works.
