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

# Manual CAS Character Setup: Step-by-Step Guide for CAS

> Manually configure Character Animation System — create CAS Settings assets, set up curve-based layered blending, and add procedural animation modifiers.

Manual setup gives you full control over every CAS component without relying on the automated wizard. Use this approach when you need a custom configuration, are integrating CAS into an existing character prefab, or simply want to understand every component in depth. Before you begin, make sure the **Character Animation System** package is already imported into your project.

## Apply the Manual Preset

Follow these steps to apply the Manual preset and add the three core CAS components to your character GameObject.

<Steps>
  <Step title="Add your character to the scene">
    Drag your character prefab into the scene hierarchy, then right-click it and select **KINEMATION ▸ Setup CAS**.
  </Step>

  <Step title="Select the Manual preset">
    In the Setup CAS window, choose the **Manual** preset from the dropdown list and click **Apply Preset**.

    Applying the preset adds three core components to your character GameObject:

    * **Character Animation** — the central hub that manages settings, blending, and playback.
    * **Layered Blending** — controls how the Base Pose and Overlay Pose are mixed across different body regions.
    * **Procedural Animation** — an optional container for runtime Animation Modifiers.
  </Step>

  <Step title="Assign an Animator Controller">
    Select the **Animator** component on the same GameObject (or a child), and assign a compatible Animator Controller in the **Controller** field.

    <Warning>
      Generic Animator Controllers only work with Generic character rigs, and Humanoid controllers only work with Humanoid avatar configurations. Mixing types will result in no animation playing at runtime.
    </Warning>
  </Step>
</Steps>

## Create the CAS Settings Asset

The **Character Animation Settings** ScriptableObject defines everything about a specific gameplay state — weapon equipped, unarmed, crouching with a specific item, and so on. You create one per gameplay state.

<Steps>
  <Step title="Open the Character Animation component menu">
    In the Inspector, locate the **Character Animation** component and click the **three-dot (⋮) menu** in its header.
  </Step>

  <Step title="Create the asset">
    Select **Create Animation Settings**. Unity saves a new ScriptableObject in the currently active Project folder.
  </Step>

  <Step title="Configure the asset fields">
    Select the newly created asset and fill in the following properties:

    <ParamField path="Blend Time" type="struct">
      Controls how the settings blend in and out when switching states.

      * **Ease Mode** — the interpolation curve (Linear, EaseIn, EaseOut, EaseInOut).
      * **Blend In Time** — seconds it takes to fully blend this state in.
      * **Blend Out Time** — seconds it takes to fully blend this state out.
    </ParamField>

    <ParamField path="Base Pose" type="AnimationClip">
      The idle or standing animation for this state. This pose represents the character's default full-body stance and is used as the lower layer in the blending stack.
    </ParamField>

    <ParamField path="Overlay Pose" type="AnimationClip">
      The weapon or item animation clip. Always assign a clip here — the Layered Blending system reads curve data from this clip to determine per-bone blend weights. Leaving this empty will cause the overlay to have no effect.
    </ParamField>

    <ParamField path="Overlay Animator" type="RuntimeAnimatorController">
      Optional. Assign an Animator Controller here if your overlay requires state machine logic — for example, switching between idle, aiming, and firing states on the upper body.
    </ParamField>

    <ParamField path="Procedural Settings" type="ProceduralAnimationSettings">
      A reference to a Procedural Animation Settings asset that lists all Animation Modifiers applied to the skeleton at runtime for this gameplay state. See the [procedural animation setup](#set-up-procedural-animation) section below.
    </ParamField>
  </Step>

  <Step title="Attach the Settings to the character prefab">
    Drag your CAS Settings asset from the Project window into the **Settings** field on the **Character Animation** component. This tells the character which settings to use at startup.

    <Tip>
      You can call `characterAnimation.UpdateAnimationSettings(mySettings)` from code at runtime to switch gameplay states — for example, when the player equips a different weapon.
    </Tip>
  </Step>
</Steps>

## Set Up Curve-Based Blending

CAS uses animation curves embedded directly in each Animation Clip to drive per-bone blend weights at runtime. This means each clip carries its own blending intent rather than relying on a global configuration.

<Steps>
  <Step title="Open the Curve Property Editor">
    In the Project window, right-click your **Overlay Animation Clip** and select **Edit Curve Properties**. The Curve Property Editor window opens, listing all animatable parameters on the clip.
  </Step>

  <Step title="Select your Character Prefab">
    In the Curve Property Editor, set the **Character Prefab** field to your player prefab. This populates the editor with the parameters available on that prefab.
  </Step>

  <Step title="Add the Layering parameters">
    Click **Add Custom Parameter** and add the following parameters. Press the **+** icon for the **Base Weight**, **Additive Weight**, and **Local Weight** sub-channels of each parameter:

    | Parameter            | Purpose                                         |
    | -------------------- | ----------------------------------------------- |
    | `Layering_LowerBody` | Controls blending for the hips, legs, and feet  |
    | `Layering_Spine`     | Controls blending for the torso and spine chain |
    | `Layering_Head`      | Controls blending for the neck and head         |
    | `Layering_Arm_R`     | Controls blending for the right arm chain       |
    | `Layering_Arm_L`     | Controls blending for the left arm chain        |
    | `Layering_Fingers`   | Controls blending for all finger bones          |

    <Note>
      The parameter names are case-sensitive and must match exactly. The `Layering_` prefix is the convention used by CAS to identify blend layer parameters.
    </Note>
  </Step>

  <Step title="Tune the blend weights">
    Enter Play Mode and adjust the weight sliders in the Curve Property Editor. Use these recommended starting values and refine them to suit your animation:

    * **`Layering_LowerBody`** — set `additiveWeight` to `1`, `baseWeight` to `0.4`. This lets the locomotion layer mostly drive the lower body while the overlay adds subtle motion on top.
    * **`Layering_Spine`** — set `baseWeight` to `1` to fully apply the overlay to the spine.
    * **`Layering_Head`** — set `baseWeight` to `1` for weapon-carrying stances where the head should follow the overlay.
    * **`Layering_Arm_R` / `Layering_Arm_L`** — set `baseWeight` to `1` so arms fully follow the overlay pose.
    * **`Layering_Fingers`** — set `localWeight` to `0`. Fingers are typically driven entirely by the overlay clip, and the local-space blend should be left at zero.

    <Tip>
      Bake your final values into the clip's curves once you are satisfied with the look. This ensures consistent results across all instances of the clip.
    </Tip>
  </Step>
</Steps>

## Understand the Layered Blending Component

The **Layered Blending** component stores the collection of blend layers that define which bones are affected by the blending parameters you configured above.

Open the component in the Inspector to view the **Layered Blend** list. Each entry in the list corresponds to one of the `Layering_*` parameters and contains a chain of bones that the parameter controls. To view and modify the bone chain for a layer, click the **Edit** button next to that layer entry — this opens an interactive bone chain selector.

Each bone in a layer uses three independent blend values driven by the curves you set:

<ParamField path="Base Weight" type="float [0–1]">
  Blends between the Base Pose (`0`) and the Overlay Pose (`1`). Use this to transition body parts from locomotion to the equipped-item pose.
</ParamField>

<ParamField path="Additive Weight" type="float [0–1]">
  Controls how much additive motion is applied on top of the current pose. Use this to add procedural breathing, sway, or recoil on specific bone regions.
</ParamField>

<ParamField path="Local Weight" type="float [0–1]">
  Blends the Overlay in local space, relative to the parent bone. This is especially useful for fingers and toes, and occasionally for arms when you need precise local-space control.
</ParamField>

<Note>
  CAS reads these values from the animation clip curves at runtime — the sliders in the Inspector are for authoring reference only. The curves always take precedence during playback.
</Note>

## Set Up Procedural Animation

Procedural animation lets you drive bones dynamically at runtime using Animation Modifiers — components such as Two Bone IK, Modify Bone, and Stabilize Bone.

<Steps>
  <Step title="Create a Procedural Animation Settings asset">
    On your character prefab, click the **three-dot (⋮) menu** on the **Procedural Animation** component and select **Create Procedural Asset**. Unity saves a new Procedural Animation Settings ScriptableObject to the current folder.
  </Step>

  <Step title="Assign the Character Prefab">
    In the Procedural Animation Settings asset, assign your main player prefab in the **Character Prefab** field. The prefab's skeleton is used to bind modifier targets to specific bones in the editor.

    <Tip>
      If you haven't created a prefab yet, drag your scene character into the Project window to create one first.
    </Tip>
  </Step>

  <Step title="Add Animation Modifiers">
    Click the **+** button in the Modifiers list and add the modifiers you need. Common choices include:

    * **Two Bone IK** — positions a two-bone chain (e.g., arm) toward an IK target.
    * **Modify Bone** — applies offset rotations or translations to a specific bone at runtime.
    * **Stabilize Bone** — counteracts parent bone rotation to keep a bone world-stable (useful for camera sockets and weapon attachments).

    You can add multiple instances of the same modifier type — for example, two separate **Two Bone IK** entries for the left and right hands.
  </Step>

  <Step title="Link the Procedural Settings to your CAS Settings">
    Open your **Character Animation Settings** asset and assign the Procedural Animation Settings asset to the **Procedural Settings** field. CAS will activate these modifiers whenever the corresponding settings are active.
  </Step>
</Steps>

<Note>
  For a full reference on every available Animation Modifier and its parameters, see the **Animation Modifiers** documentation section.
</Note>
