> 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/unity-plugin-beta-overview/features/emotion/emotion-profile.md).

# Emotion Profile

## 使用 ConvaiEmotionProfile 调整情绪行为

`ConvaiEmotionProfile` 是情绪系统的核心配置资源。它控制表情进入和退出的速度、每种新情绪是否会伴随一小段强度爆发、系统如何防止面部长期停留在一个僵硬姿势，以及哪些输出绑定会将分数传递到角色的网格或 Animator。每个参数都带有合理的默认值，因此你可以先从随附示例开始，再逐步微调。

## 创建配置文件资源

在项目窗口中，右键单击你的 `Assets/` 文件夹，并选择：

**创建 → Convai → Embodiment → Emotion Profile**

一个名为 `ConvaiEmotionProfile` 会出现。将其重命名为更具描述性的名称（例如， `NPC_Guard_EmotionProfile`）并将其分配给角色的 **Profile** 字段。 `ConvaiEmotionController` 组件。

{% hint style="info" %}
如果想在不创建资源的情况下开始，请分配随附的 `ConvaiSamplesShared_EmotionProfile` 从 `Packages / Convai SDK for Unity / SamplesShared / Resources / Embodiment / Modules / Emotion`. 如果你想编辑任何值，请先复制它——包内的资源是只读的。
{% endhint %}

## 分类法

<table><thead><tr><th width="121.5">字段</th><th width="225.49993896484375">默认值</th><th>描述</th></tr></thead><tbody><tr><td><code>分类法</code></td><td><em>（无——Plutchik 内置）</em></td><td>可选 <code>EmotionTaxonomyAsset</code> 定义系统识别哪些情绪标签，以及如何将服务器标签解析为规范名称。留空则使用内置的九情绪 Plutchik 集。</td></tr></tbody></table>

该分类体系还为每种情绪提供了嘴部影响提示，供 LipSync 混合层使用。有关内置集合的完整细节以及如何创建自定义分类，请参阅 Emotion Taxonomy。

## 平滑

来自服务器的情绪分数不会立即应用。累加器会在每一帧执行指数平滑，使表情自然融合，而不是在数值之间突然跳变。

<table><thead><tr><th width="168.5">字段</th><th width="120.99993896484375">范围</th><th width="104.49993896484375">默认值</th><th>描述</th></tr></thead><tbody><tr><td><code>lerpSpeed</code></td><td>0.1 – 20</td><td><strong>5</strong></td><td>分数向目标值上升的速度。数值越高，响应越迅速；数值越低，感觉越缓和。</td></tr><tr><td><code>decaySpeed</code></td><td>0.1 – 20</td><td><strong>2</strong></td><td>一旦目标被移除，分数回落到零附近的速度。默认情况下，衰减被刻意设得比上升更慢，让情绪有时间自然停留。</td></tr><tr><td><code>intensityOffset</code></td><td>-0.25 – 0.25</td><td><strong>0</strong></td><td>在进入累加器之前添加到每个归一化强度值上的固定偏置。正值会让所有情绪看起来更强烈；负值则会让它们更收敛。</td></tr></tbody></table>

**指数平滑的工作方式：** 每一帧，当前分数都会向目标值缩短剩余距离的一部分。 `lerpSpeed = 5`时，分数大约会在 1 秒内覆盖该距离的 99%。将速度翻倍会使达到完整表情所需的时间减半。当目标降为零时，衰减也使用同样的机制。

## 微表情爆发

当一个新情绪到来时，累加器可以施加短暂的超调——在稳定状态水平之上出现一个短促峰值——然后再回落。这会让表情有一个有力、自然的进入效果，在屏幕上的观感远胜于简单的线性上升。

<table><thead><tr><th width="196.49993896484375">字段</th><th width="126.5">范围</th><th width="96.5">默认值</th><th>描述</th></tr></thead><tbody><tr><td><code>microBurstEnabled</code></td><td>—</td><td><strong>true</strong></td><td>启用或完全禁用爆发效果。</td></tr><tr><td><code>microBurstDuration</code></td><td>0.05 – 1.5 秒</td><td><strong>0.25 秒</strong></td><td>超调包络在分数衰减到其持续值之前持续的时间。</td></tr><tr><td><code>microBurstOvershoot</code></td><td>1.0 – 3.0×</td><td><strong>1.4×</strong></td><td>应用于爆发顶点分数的峰值倍数。1.4 表示表情会短暂达到其持续水平之上 40%。</td></tr><tr><td><code>microBurstThreshold</code></td><td>0 – 1</td><td><strong>0.15</strong></td><td>触发一次爆发所需的最小分数变化量。低于该阈值的小幅波动会在不触发爆发的情况下被平滑，从而避免细微情绪变化带来的抖动。</td></tr></tbody></table>

{% hint style="info" %}
对于平静、专业的模拟，将 `microBurstOvershoot` 降低到 1.1–1.2，或完全禁用爆发。对于高能量或戏剧化角色，最高可用到 1.8。
{% endhint %}

## 中性交替

如果角色接收到持续的情绪信号——例如在一段长时间的讲解中始终保持“好奇”——最终可能会出现僵住的表情，从而破坏沉浸感。中性交替通过周期性地将当前表情淡出到中性，然后再恢复回来来解决这个问题，即使底层情绪保持不变，也能创造出微妙且逼真的变化。

<table><thead><tr><th width="241">字段</th><th width="113">范围</th><th width="99.49993896484375">默认值</th><th>描述</th></tr></thead><tbody><tr><td><code>neutralAlternationEnabled</code></td><td>—</td><td><strong>true</strong></td><td>启用或禁用交替系统。</td></tr><tr><td><code>alternationMinInterval</code></td><td>0.5 – 30 秒</td><td><strong>3 秒</strong></td><td>在开始一次中性回落之前，当前表情至少保持的时间。</td></tr><tr><td><code>alternationMaxInterval</code></td><td>0.5 – 30 秒</td><td><strong>7 秒</strong></td><td>最长保持时间。实际间隔会在每个周期内于最小值和最大值之间随机选择。</td></tr><tr><td><code>alternationBlendDuration</code></td><td>0.05 – 5 秒</td><td><strong>1 秒</strong></td><td>过渡到中性（再回到原表情）所需的时间。较短的值会产生清晰、明确的重置；较长的值则几乎察觉不到。</td></tr><tr><td><code>alternateOnlyWhileTalking</code></td><td>—</td><td><strong>false</strong></td><td>启用后，只有当角色正在说话时才会发生交替。如果你希望轮次之间的停顿更稳定地保持表情，这会很有用。</td></tr></tbody></table>

{% hint style="warning" %}
设置 `alternationMinInterval` 和 `alternationMaxInterval` 将这两个值设得同样很低（例如都设为 1 秒）会让面部看起来像是在闪烁，而不是自然交替。请让两个值之间至少相差 2–3 秒，并且对大多数角色而言，将最小值保持在 2 秒以上。
{% endhint %}

## Output Bindings

该配置文件的 **Blendshape Binding** 和 **Animator Binding** 部分定义了每一帧将平滑后的情绪分数发送到哪些网格 blendshape 和 Animator 浮点参数。这些内容配置为 `EmotionSlotBinding` 条目列表——每个输出通道中，每种情绪对应一个槽位。

完整的字段定义、针对不同骨骼的指导，以及预构建的 `RealisticEmotionSlots` 工厂方法都在 [Output Bindings](/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/features/emotion/output-bindings.md).

## 结论

`ConvaiEmotionProfile` 将所有平滑处理、微爆发、交替以及输出配置整合到一个可移植资源中，你可以在多个 NPC 预制体之间共享。继续 [Output Bindings](/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/features/emotion/output-bindings.md) 以将平滑后的分数连接到角色的面部，或查看 [Emotion Taxonomy](/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/features/emotion/emotion-taxonomy.md) 以了解并自定义情绪词汇。


---

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

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/features/emotion/emotion-profile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
