> 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 角色添加待机、说话动作、行走和手势的指南。

Body Animation 是 Convai 的化身模块，用于播放角色的待机、说话、移动、动作和指向动画。其中一个组件， `ConvaiBodyAnimationController`会直接针对 Humanoid `PlayableGraph` 构建并运行分层 `Animator` ——无需创建 Animator Controller 资源。动画内容来自你指定的 `ConvaiBodyAnimationSet` ，行为则通过 `ConvaiBodyAnimationConfig`.

***

### 身体动画能为角色带来什么

| 行为    | 表现形式                                                             |
| ----- | ---------------------------------------------------------------- |
| 待机    | 角色会在预先制作的多种待机动画之间切换，而不是一直保持同一个静止姿势。                              |
| 说话动作  | 角色说话时播放上半身手势动画，并根据实时语音能量调整幅度。                                    |
| 移动    | 与 NavMesh 同步的行走和慢跑；如果动画集中包含相应动画，还会播放有方向性的起步、停止和转身动作。             |
| 动作和手势 | 通过 Convai 动作触发，或由你自己的代码通过 `wave` 或 `dance`等命名动画片段。 `PlayAction`. |
| 指向    | 角色会朝世界坐标中的位置或移动目标抬起手臂，并保持姿势。                                     |

通过 `ConvaiBodyAnimationController` 将组件添加到角色： **Convai > Embodiment > Body Animation**。SDK 自带默认动画集，因此新角色无需先为其寻找动画片段，也能开始移动。

***

### 无需 Animator Controller 资源

你可能熟悉的其他 Unity 动画工作流——例如状态、过渡，以及在 Animator 窗口中配置参数——在这里并不适用。控制器完全通过代码，基于你指定的 `PlayableGraph` 构建其 `ConvaiBodyAnimationSet` 和 `ConvaiBodyAnimationConfig` ；任一项发生变化时，都会重新构建。 [身体动画的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation/how-body-animation-works.md) 介绍此图运行的分层结构。

***

### 入门指南

{% content-ref url="/pages/0b1776a0ab300843aca8154fbdecf361fa671b9d" %}
[身体动画快速入门](https://docs.convai.com/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="https://docs.convai.com/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>使用随附的动画集添加组件，并在 Play 模式下查看待机和说话动作。</td><td><a href="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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="https://docs.convai.com/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
