> 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/emotion/quick-start.md).

# 情绪快速入门

将 Convai Emotion 组件添加到角色，运行其设置检查清单，并在 Play 模式下看到面部对对话作出反应。

添加 `ConvaiEmotionController` 将其应用到现有的 Convai 角色，为其指定一个角色类型，并确认其面部在 Play 模式下会对对话做出反应。等你已经有一个可用的 `ConvaiCharacter` 已放入场景中，并希望在调整任何设置之前先查看 Emotion 是否运行。

***

### 前提条件

* 某个 `ConvaiCharacter` 在你的场景中，已经可以连接并响应——先完成 [验证你的设置](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started/validate-your-setup.md) 如果你还没有的话，请先完成。
* 一个带骨骼绑定的面部网格，其 blendshape 遵循受支持的命名约定（ARKit、Reallusion CC3、Reallusion CC4 Extended 或 MetaHuman）。对于其他任何命名约定，请指定一个 `CustomRigConventionMap` 先——参见 [角色骨骼设置](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/character-rig-setup.md).

{% hint style="info" %}
Emotion 不需要 `ConvaiEmotionProfile` 资源即可运行。仅添加该组件就会以 SDK 内置默认值运行——执行下面的设置会为角色赋予一个初始人格，而不是让每个设置都保持默认。
{% endhint %}

***

### 添加并设置 Emotion 组件

{% stepper %}
{% step %}

#### 选择角色

在 Hierarchy 中，选择 `GameObject` 携带 `ConvaiCharacter` 组件。
{% endstep %}

{% step %}

#### 添加 Emotion 组件

在 Inspector 中，选择 **Add Component**，然后 **Convai > 具身化 > Emotion**。这会添加 `ConvaiEmotionController` 到角色上。

Convai 还会添加该模块所需的基础结构——一个 `EmbodimentContext`、一个 `StandardRigBinding`，以及内部的 `MoodCommandHandlerAdapter` 它可让 Convai 的回复自动设置此角色的心情——你无需自行添加其中任何一个。
{% endstep %}

{% step %}

#### 阅读设置清单

该 `ConvaiEmotionController` 检查器会打开一个清单： **Character**, **面部**, **面部骨骼绑定**，以及 **人格**。每一行都会报告它找到的内容；无法解析的行会指出修复方法。
{% endstep %}

{% step %}

#### 选择一种角色类型并运行设置

选择四个中的一种 **角色类型** 按钮——Composed、Warm、Energetic 或 Reserved——然后选择 **设置情绪**。这会在角色的预制体旁创建一个人格资源，并将其分配给 **人格** 字段，并报告它找到的内容。无需其他操作。
{% endstep %}
{% endstepper %}

***

### 验证设置

进入 Play 模式并与角色对话。随着 Convai 的回复到来，检查器的 **Live** 部分会更新： **感受** 显示当前激活的情绪，而 **强度** 显示其强度，而 **心情** 显示回合之间角色的静息心情。

{% hint style="success" %}
**预期结果：** 随着对话的发展，角色的表情会发生变化，然后在回合之间逐渐回到所选角色类型的静息心情。在 Warm 或 Energetic 下，即使什么都没说，面部也应明显更友好。
{% endhint %}

若要在不与角色对话的情况下预览表情，请使用检查器的 **Live** 部分：选择一种情绪，设置强度，然后选择 **试试**；选择 **停止** 以释放它。

***

### 工作原理

与角色对话会随回复向 Convai 发送一个情绪信号。 `ConvaiEmotionController` 通过情绪分类体系解析该信号，平滑其强度，并通过共享面部合成器将其合成到角色面部上。完整流程请参见 [情绪系统的工作原理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/how-the-emotion-system-works.md).

***

### 故障排除

如果清单报告 **面部骨骼绑定** 为未解析，或者设置完成后面部没有任何动作，请参见 [情绪故障排查](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/troubleshooting-and-diagnostics.md).

***

### 下一步

{% content-ref url="/pages/a169ddd3c944e6f42f2701922ad7b55a03ac789a" %}
[情绪系统的工作原理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/how-the-emotion-system-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/f5a3aaba473b4dfb20969b46c9a49bc4b176f223" %}
[心情](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/moods.md)
{% endcontent-ref %}

{% content-ref url="/pages/5a9247365092d958f2d539ae98bdfe69f72df091" %}
[Emotion 配置文件](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/emotion/emotion-profile.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 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/emotion/quick-start.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.
