> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation.md).

# 身体动画

查找使用代码驱动的 Body Animation 模块为 Convai 角色添加待机、说话动作、行走和手势的指南。

身体动画是 Convai 具身模块，可播放角色的待机、说话、移动、动作和指向动作。一个组件， `ConvaiBodyAnimationController`，构建并运行一个分层的 `PlayableGraph` 直接针对 Humanoid `Animator` ——无需编写 Animator Controller 资源。内容来自一个 `ConvaiBodyAnimationSet` 你分配的，而行为则在一个 `ConvaiBodyAnimationConfig`.

***

### 身体动画为角色带来的效果

| 行为    | 它的外观                                                        |
| ----- | ----------------------------------------------------------- |
| 空闲    | 角色会在多个已制作的待机变体之间切换，而不是保持一个静态姿势。                             |
| 说话动作  | 角色说话时，会播放上半身手势片段，并根据实时语音能量进行缩放。                             |
| 移动    | 与 NavMesh 同步的步行和慢跑；当所选素材集制作了这些动作时，还会包含方向性的起步、停止和转身。         |
| 动作和手势 | 命名片段，例如 `挥手` 或 `舞蹈`，由 Convai 动作触发，或通过你自己的代码触发 `PlayAction`. |
| 指向    | 角色会将手臂抬向世界中的某个位置或一个移动目标，并保持该姿势。                             |

添加 `ConvaiBodyAnimationController` 到角色上，通过 **Convai > 具身化 > 身体动画**。SDK 随附一套默认动画集，因此新角色无需你先获取任何片段就能移动。

***

### 无需 Animator Controller 资源

你可能已知的其他 Unity 动画工作流——在 Animator 窗口中配置状态、过渡和参数——在这里都不适用。该控制器会完全根据 `PlayableGraph` 在代码中完全基于 `ConvaiBodyAnimationSet` 和 `ConvaiBodyAnimationConfig` 你分配的内容进行构建，并在任一项发生变化时重新构建它。 [身体动画的工作方式](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/how-body-animation-works.md) 涵盖了该图所运行的层级堆栈。

***

### 从哪里开始

{% content-ref url="/pages/0b1776a0ab300843aca8154fbdecf361fa671b9d" %}
[身体动画快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/quick-start.md)
{% endcontent-ref %}

***

### 探索身体动画

<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>身体动画的工作方式</strong><br>用于播放待机、说话、动作和指向动作的分层图，以及对话状态如何驱动它。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/how-body-animation-works.md">身体动画工作原理</a></td></tr><tr><td><strong>身体动画快速入门</strong><br>添加带有随附动画集的组件，并在播放模式下查看待机和说话动作。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/quick-start.md">身体动画快速入门</a></td></tr><tr><td><strong>构建动画集</strong><br>从一个片段文件夹中，或逐项，自行组装你的 ConvaiBodyAnimationSet。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/build-an-animation-set.md">构建动画集</a></td></tr><tr><td><strong>配置运动</strong><br>添加 ConvaiNavMeshLocomotion，或连接自定义移动源，并调节步行和慢跑速度。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/configure-locomotion.md">配置移动</a></td></tr><tr><td><strong>播放动作和手势</strong><br>从你自己的代码中触发命名动作、锚定动作和指向。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/play-actions-and-gestures.md">播放动作和手势</a></td></tr><tr><td><strong>身体动画配置参考</strong><br>按部分分组的每个 ConvaiBodyAnimationConfig 字段及其默认值。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/config-reference.md">身体动画配置参考</a></td></tr><tr><td><strong>身体动画脚本参考</strong><br>ConvaiBodyAnimationController 的公开 API：方法、句柄和事件。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/scripting-reference.md">身体动画脚本参考</a></td></tr><tr><td><strong>身体动画使用示例</strong><br>一个引导式行走、一个按提示触发的手势，以及对场景对象的指向。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/usage-examples.md">身体动画使用示例</a></td></tr><tr><td><strong>排查身体动画故障</strong><br>无动作、T 姿势、移动不同步，以及如何阅读跟踪日志。</td><td><a href="/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/troubleshooting.md">身体动画故障排查</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
