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

# 📚Setup

> In this section we will learn how to set up Magic Blending.

## Add Animator Component

First, add your character to the scene and add the **Animator** component. Make sure to assign the **Animator Controller** as well:

<Frame caption={"Example Animator from the demo project."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/05f0078422f07a9e2fc2.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=7f9334e62abd9a1206ef0b1be4a36638" alt="" width={378} data-path="images/magic-blend/05f0078422f07a9e2fc2.png" />
</Frame>

## Create Rig Asset

Open up your character hierarchy and find the root bone (it can also be called "Armature", "Hips", etc.):

<Frame caption={"Select the root bone."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/ca80089a4d1538901395.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=861df58de5af6e119ee2a129e0643351" alt="" width={563} data-path="images/magic-blend/ca80089a4d1538901395.png" />
</Frame>

Next, right-click on the root bone and select **Auto Rig Mapping**:

<Frame caption={"Click that button."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/512922d8719474efa9ec.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=c82147821f3d88d4fbc956cd71c6c93f" alt="" width={309} data-path="images/magic-blend/512922d8719474efa9ec.png" />
</Frame>

After this, a **Rig Asset** will be generated in the active folder:

<Frame caption={"Rig Asset contains information about your character skeleton."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/006d4b80effceab303f2.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=827a37f43ebf44024b5a001ca52ef010" alt="" width={448} data-path="images/magic-blend/006d4b80effceab303f2.png" />
</Frame>

<Tip>
  **Note**: the Rig Asset stores information about the character's hierarchy as a Scriptable Object.
</Tip>

## Create Magic Blend Asset

Right-click on your **Rig Asset** and select **Create Magic Blend**:

<Frame caption={"Hit that button."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/027336c0c53f27cb2884.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=5fe7c6d5275b594132a48552c9da43d2" alt="" width={397} data-path="images/magic-blend/027336c0c53f27cb2884.png" />
</Frame>

Now, a **Magic Blend Asset** has been generated in the active folder:

<Frame caption={"Magic Blend Asset."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/98fbba769b52603adab2.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=539717ecef629f803428475590db1324" alt="" width={377} data-path="images/magic-blend/98fbba769b52603adab2.png" />
</Frame>

Let's break down each property:

* **Rig Asset** - target skeleton asset, keep it as is.

* **Blend Time** - blend in time in seconds.

* **Blend Curve** - blend in curve. It will be used to blend in the *Magic Blend Asset* when it becomes active.

* **Base Pose** - the idle stance pose. It will be "subtracted" from the *Animator* output to generate additive animation.

* **Overlay Pose** - custom weapon or item pose. It will be animated in runtime.

* **Override Overlays** - use these overrides to add custom animations to your overlay pose.

* **Overlay Speed** - play rate of the overlay animation.

* **Is Animation** - set this to true to play the clip as an animation.

* **Layered Blends** - settings for each bone chain with weights. Use it to adjust the blending. By default, the plugin will generate these bone chains:

  * Lower Body

  * Spine

  * Head

  * Arms

  * Fingers

* **Global Weight** - controls the global influence of the blending: 0 is disabled and 1 is fully active.

## Assign Poses

Pick the idle and overlay poses you like and assign them in the **Magic Blend Asset**:

<Frame caption={"Example poses."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/cef65a4cf79f6162873b.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=ef557c7b2acad85c29651084a0291f0a" alt="" width={369} data-path="images/magic-blend/cef65a4cf79f6162873b.png" />
</Frame>

In this example, we will choose standing idle and wizard poses. Additionally, if you want to combine multiple overlays, add overrides:

<Frame caption={"Assign the pose, mask and weight."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/46d0cc69efd5599de3b7.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=8ae9f5852104dd5f35220edb0c106594" alt="" width={375} data-path="images/magic-blend/46d0cc69efd5599de3b7.png" />
</Frame>

You can add as many overrides as you want, make sure to specify the **Animation Clip** and the **Avatar Mask** (it will tell the system what bones to override for the Overlay).

If your overlay is an animation (e.g. shooting or attacking), specify the **Overlay Speed** and check **Is Animation**:

<Frame caption={"Settings for animations."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/e3c3614ee5789564ce82.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=da6ba8a1f0f50e28c9ad0f8229fadc81" alt="" width={371} data-path="images/magic-blend/e3c3614ee5789564ce82.png" />
</Frame>

## Adjust Layered Blending

Open up the **Layered Blends** list and adjust the bone chains:

<Frame caption={"Example lower body chain."}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/5c3e03bdce4c0c7cca7f.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=16072680e635c9cb2cccd134e53ed6fc" alt="" width={417} data-path="images/magic-blend/5c3e03bdce4c0c7cca7f.png" />
</Frame>

<Tip>
  **Note**: it works similarly to the *Avatar Masks*. Select the bones you need and toggle the check box to confirm selection.
</Tip>

In the next section, we will explain how to adjust the blending values to achieve the desired result.

## Add Magic Blending

Navigate to your character prefab and add a **Magic Blending** component. Ensure you add it to the same Game Object that the Animator is attached to:

<Frame caption={"Component is ready!"}>
  <img src="https://mintcdn.com/kinemation/MwuYlII5X7NMKvR6/images/magic-blend/3040cf6c2789b6e24b3d.png?fit=max&auto=format&n=MwuYlII5X7NMKvR6&q=85&s=71d3214c6194b9b1fdb4faf8faeeac46" alt="" width={393} data-path="images/magic-blend/3040cf6c2789b6e24b3d.png" />
</Frame>

<Tip>
  **Tip**: you can drag and drop the Magic Blend Asset on the character prefab, and the component will be added automatically!
</Tip>

All you have to do is assign the **Magic Blend Asset** in this component. Now you can start the game and play around with the values in the **Magic Blend Asset**!
