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

# CAS Troubleshooting: Common Issues, Errors, and Fixes

> Diagnose and fix CAS issues: animation not playing, camera at feet, Unity 2022 NativeReference error, overlay not visible, and controller switch snapping.

This page covers the most frequently encountered issues when setting up and using the Character Animation System. Each section describes the symptom and the exact steps needed to resolve it. If your issue is not listed here, check the `#support` channel on the [Kinemation Discord](https://discord.gg/kinemation-1027338787958816860) for community help and official responses.

<Accordion title="Character is not animated when the game starts">
  **Symptom:** The character stands in a T-pose or default bind pose when you enter Play Mode. No animations play.

  **Cause:** The `Animator` component on the character does not have an Animator Controller assigned, or the assigned controller is incompatible with the character's avatar type.

  **Fix:**

  1. Select your character prefab and locate the **Animator** component.
  2. Check the **Controller** field — if it is empty, assign an appropriate Animator Controller.
  3. Verify that the controller's avatar type matches your character:
     * A **Generic** Animator Controller must be used with a **Generic** rig. It will only animate the specific character mesh it was authored for.
     * A **Humanoid** Animator Controller must be used with a **Humanoid** avatar and a properly configured Avatar definition.
  4. If you are using the CAS demo content, the Generic controller lives at `Assets/CAS Demo/Animations/Generic/` and the Humanoid controller at `Assets/CAS Demo/Animations/Humanoid/`.

  After assigning the correct controller, enter Play Mode to confirm the character animates.
</Accordion>

<Accordion title="Camera appears at the character's feet in first-person view">
  **Symptom:** When **Is First Person** is set to `true` on the `CharacterCamera` component, the camera drops to ground level and the player sees the floor instead of a first-person perspective.

  **Cause:** The **First Person Socket** transform on the `CharacterCamera` component is not assigned. When no socket is set, the camera defaults to the world origin relative to the player root, which places it at foot level.

  **Fix:**

  1. Select the character prefab and find the **Character Camera** component.
  2. Locate the **First Person Socket** field under the **Transforms** section.
  3. Assign the head bone, a dedicated camera socket child transform, or any empty GameObject positioned at the character's eye level.
  4. If your character does not have a head bone accessible from the camera's parent, create an empty GameObject, parent it to the head bone, position it at eye height, and assign that transform as the socket.

  Enter Play Mode and toggle to first-person — the camera should now track the socket at the correct height.
</Accordion>

<Accordion title="Unity 2022 compile error: NativeReference<> not found">
  **Symptom:** After importing CAS into a Unity 2022 project, the console shows this error and the project fails to compile:

  ```text theme={null}
  Assets\KINEMATION\CharacterAnimationSystem\Scripts\Runtime\Playables\AnimationLayeringJobs.cs(27,16): error CS0246: The type or namespace name 'NativeReference<>' could not be found (are you missing a using directive or an assembly reference?)
  ```

  **Cause:** Unity 2022 does not include the `NativeReference<T>` type in the base `Unity.Collections` assembly without the standalone Collections package. CAS requires this type for its animation job system.

  **Fix:**

  1. First, update CAS to the latest version from the Asset Store to ensure you have the most recent compatibility fixes.
  2. Open **Window ▸ Package Manager**.
  3. Set the package source dropdown to **Unity Registry**.
  4. Search for **Collections** and install the `com.unity.collections` package.
  5. Wait for the domain reload to complete. The compile error should disappear.

  <Note>
    The Collections package is a first-party Unity package and has no negative side effects on your project. It is required for all projects using Unity Jobs in Unity 2022.
  </Note>
</Accordion>

<Accordion title="Overlay pose is not visible — upper body stays in base pose">
  **Symptom:** You have assigned an Overlay Pose clip in your CAS Settings, but the character's upper body shows no influence from the overlay at runtime. The character appears to only play the base locomotion animation on all bones.

  **Cause:** The blend weights that tell CAS how much overlay to apply are stored as animation curves embedded in the Overlay Pose clip itself. If those curves have not been added, the blend weights all default to zero, and the overlay has no visible effect.

  **Fix:**

  1. In the Project window, right-click your **Overlay Pose** clip and select **Edit Curve Properties**.
  2. In the Curve Property Editor, set the **Character Prefab** field to your player prefab.
  3. Click **Add Custom Parameter** and add the following parameters: `Layering_LowerBody`, `Layering_Spine`, `Layering_Head`, `Layering_Arm_R`, `Layering_Arm_L`, `Layering_Fingers`.
  4. For each parameter, press the **+** icon to add **Base Weight**, **Additive Weight**, and **Local Weight** sub-channels.
  5. Set the **Base Weight** to `1` for the spine, head, and arm parameters. Set **Additive Weight** to `1` and **Base Weight** to `0.4` for `Layering_LowerBody`. Set **Local Weight** to `0` for `Layering_Fingers`.
  6. Bake the values into the curves and return to Play Mode to verify the overlay is blending correctly.

  See the [Manual Setup guide](/cas/guides/manual-setup#set-up-curve-based-blending) for a full walkthrough of recommended curve values.
</Accordion>

<Accordion title="Setup Wizard reports missing bones">
  **Symptom:** When running the CAS Setup Wizard on your character, the wizard shows a warning that one or more expected bones could not be found in the hierarchy. The automatic bone assignment is incomplete.

  **Cause:** The wizard attempts to locate bones by conventional naming patterns (e.g., `Spine`, `LeftArm`, `RightHand`). If your character uses a non-standard naming convention or a proprietary rig, the automatic detection may fail to match some bones.

  **Fix — Option A: Assign bones manually:**

  1. After the wizard completes, open the **Character Skeleton** component on the root bone.
  2. Expand the **Skeleton** list and locate the entries that are missing (shown as `None`).
  3. Drag the correct bone transforms from the hierarchy into each empty slot.
  4. Click **Update Skeleton** and apply to the prefab.

  **Fix — Option B: Use the Default skeleton type:**

  1. In the Setup Wizard, change the **Skeleton Type** to **Default** before applying.
  2. The Default type skips named bone matching and populates the skeleton list from the full transform hierarchy instead.
  3. After setup, manually assign the correct blend layer bone chains in the **Layered Blending** component.

  <Tip>
    If you work with a consistent custom naming convention across multiple characters, you can extend the wizard's bone name lookup table to recognize your convention. Check the CAS source for the `BoneNameResolver` class.
  </Tip>
</Accordion>

<Accordion title="Animation feels wrong or snaps after switching Animator Controllers">
  **Symptom:** When your game logic switches to a different Animator Controller at runtime (for example, switching from an unarmed controller to an armed controller), the character's pose snaps abruptly or plays a jarring transition.

  **Cause:** When an Animator Controller is swapped without notifying CAS, the animation system does not know to blend from the previous pose to the new one. The playable graph is rebuilt immediately, producing a visual pop.

  **Fix:** Call `RequestPoseBlending` on the `CharacterAnimation` component before or immediately after switching the controller. This tells CAS to capture the current pose and blend from it into the incoming animation:

  ```csharp theme={null}
  // Before switching the Animator Controller:
  _characterAnimation.RequestPoseBlending();

  // Then switch the controller as normal:
  _animator.runtimeAnimatorController = newController;
  ```

  `RequestPoseBlending` captures a snapshot of the current skeleton pose and uses it as the starting point for a smooth cross-fade into the new controller's default state. The blend duration is controlled by the **Blend In Time** value in the active CAS Settings asset.
</Accordion>
