> 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-language/how-body-language-works.md).

# 肢体语言如何运作

了解 Body Language 如何在每个 tick 驱动 Convai 角色的姿态、呼吸和手势，以及它如何让位于脚本手势。

每个 tick， `ConvaiBodyLanguageController` 都会读取角色的对话状态和情绪，判断此刻应呈现怎样的行为，并将其叠加到骨骼上，同时保留 Body Animation 和 Gaze 已施加的动作。本页将介绍影响这一判断的因素、生成动作的各个部分，以及避免 Body Language 与脚本化手势相互冲突的规则。有关这些机制所依托的组合根模型，请参阅 [角色具身化](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/core-concepts/character-embodiment.md).

***

### 每个 tick 如何驱动身体动作

在具身化 `Cognition` tick 中，控制器会读取角色当前的 [对话状态](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/core-concepts/dialogue-state.md) 和情绪读数，然后根据该状态确定配置文件中的策略：手势强度、倾听时的前倾程度、姿势倾向、呼吸频率和深度，以及小动作频率。状态变化不会让策略瞬间跳变：各项数值会在配置文件设定的 `Policy Transition Seconds` 时长内平滑过渡，因此角色开始说话时不会突然出现明显的动作顿挫。

在之后的 `Expression` tick 中，Animator 或 `PlayableGraph` 为骨骼设定姿势后、Gaze 执行前，控制器中的求解器会朝该 tick 的目标回弹，并将各个通道——脊柱、肩部、骨盆、头部手势回退动作——累积到一个共享合成器中；合成器会对每根骨骼恰好执行一次受保护的写入。两个 Body Language 行为不会在同一根骨骼上不断累积无界增量，因为始终只有一个写入器。

***

### 叠加到身体上的行为

在内部，十个相互协作的部分各自负责生成这一行为的一部分。它们都不是公共 API；你可以通过 [调整表现力](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-language/tune-expressiveness.md) 和 [配置文件参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-language/profile-reference.md)中介绍的配置文件字段来调整其效果，而不是直接调用这些部分。

| 行为     | 生成的效果                                                 |
| ------ | ----------------------------------------------------- |
| 姿势     | 根据当前状态和情绪呈现的持续性开放感、身体前倾和肩部紧张度所构成的轮廓。                  |
| 呼吸     | 胸部和肩部持续扩张的呼吸循环，以及屏息换气、叹息和说话前吸气等事件。                    |
| 手势动作   | 说话时随语音能量同步的点头节拍和姿势脉冲，以及手势之间闲置时手部和手腕的细微动作。             |
| 倾听姿势   | 角色倾听时呈现的前倾和静止状态。                                      |
| 小动作    | 缓慢的闲置重心转移，避免静止的角色看起来像被冻住一样。                           |
| 站姿     | 站立时身体周期性地转移骨盆重心并进行偏航的动作循环。                            |
| 姿势摇摆   | 脊柱持续发生的小于一度的偏移，呈现为不断进行的微调平衡，而非抖动。                     |
| 闲置宏观循环 | 以数分钟为周期，极缓慢地改变呼吸深度、摇摆和小动作节奏，避免角色长时间闲置时逐渐固定在明显重复的动作基线。 |
| 反应动作   | 一次性的惊吓瑟缩和愉悦弹跳，可由情绪突然激增自动触发，也可按需触发。                    |
| 头部手势   | 点头、摇头和倾斜头部，包括伴随说话节拍的动作、倾听时保持的倾斜姿势，或脚本发出的请求。           |

这些行为还会同时应用一个基于摄像机距离的缩放效果：主摄像机离角色越远，摇摆和手部细微动作看起来就越明显，这样小幅摆动不会在远处消失，在近景特写中也不会显得过于夸张。该效果不会影响呼吸、姿势或手势，只会调整环境动作的细节。

***

### 如何与 Gaze 和 Body Animation 共用骨骼

Body Language、Gaze 和 Body Animation 都可能需要控制同一条脊柱、肩部和头部。Convai 通过协调而非让一个模块压制另一个模块来解决这一问题：Gaze 自身的躯干瞄准行为会通过 Body Language 使用的同一个共享合成器进行组合，因此两者不会分别持有写入保护，从而避免同时写入同一根骨骼时发生竞争。当 Body Animation 播放行走循环或全身动作时，它会在播放期间接管身体——这是有意进行的交接，并非冲突。

{% hint style="info" %}
这套协调机制背后的约定——例如 Gaze 如何注册躯干瞄准条目、Body Animation 如何报告当前播放内容——都属于程序包内部实现。你无需直接实现或调用它们，只需观察它们对角色动作的影响。
{% endhint %}

***

### 如何让位于脚本化手势

Body Animation 的说话片段系统每个 tick 都可以报告一个抑制级别，而 Body Language 的整个伴随说话系统会在决定动作幅度前读取该级别：

| 抑制                    | 头部节拍 | 姿态脉动 | 语义手势提示 | 姿态与呼吸           |
| --------------------- | ---- | ---- | ------ | --------------- |
| 无（或未注册表演者）            | 完整   | 完整   | 符合条件   | 完整权重            |
| 上半身（正在播放上半身对话片段或移动动作） | 完整   | 降低   | 拒绝     | 姿态权重降低，呼吸保持完整权重 |
| 全身（正在播放全身动作或转身动作）     | 无    | 无    | 拒绝     | 两者都渐隐至零         |

这就是为什么这两个模块看起来从不会相互冲突：当 Body Animation 播放预先制作的上半身手势时，Body Language 会让角色继续呼吸、保持头部节拍，但会收敛一些，不再在同一动作上叠加自己的姿态脉动。呼吸有意地永不受抑制，即使姿态和手势在完全抑制时渐隐也不例外——角色做手势时停止呼吸，会让人觉得它出了故障，而这种违和感无可比拟。

***

### 后续步骤

{% content-ref url="/pages/b2ad39829dc48a1cbdd51297da72ea87b10b339f" %}
[肢体语言快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-language/quick-start.md)
{% endcontent-ref %}

{% content-ref url="/pages/652efa54160d6791ad8f9dfe70dc962fa595d73a" %}
[调节表现力](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-language/tune-expressiveness.md)
{% endcontent-ref %}

{% content-ref url="/pages/36545202fce61c9549c36fc04283ca75f22dd128" %}
[肢体语言故障排查](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-language/troubleshooting.md)
{% endcontent-ref %}


---

# 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-language/how-body-language-works.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.
