> 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/gaze.md).

# 视线

查找使用 Gaze 具身化模块为 Convai 角色添加眼神接触、注意力转移和全身转向的指南。

Gaze 是 Convai 的具身化模块，用于决定角色看向哪里：与玩家进行眼神交流、瞥看物体和其他角色，以及在玩家移出视野时转动整个身体。其中一个组件 `ConvaiGazeController`会协调眼睛、头部和身体的动作，让角色的注意力表现为连贯一致的行为，而不是多个系统争相控制同一组骨骼。

### Gaze 能为角色带来什么

| 行为    | 表现形式                                         |
| ----- | -------------------------------------------- |
| 眼神交流  | 角色在聆听和说话时，眼睛和头部会跟随玩家，并在轮到对方说话时自然移开视线。        |
| 注意力转移 | 角色会瞥看场景中的物体、其他 Convai 角色，以及玩家当前正在注视的对象。      |
| 身体转向  | 当玩家偏离角色正前方足够远，或走到角色身后时，角色会转动身体，而不只是转头。       |
| 对话感知  | 角色的投入程度、回避行为和身体动作参与度都会随当前对话状态而变化，而不是按固定循环运行。 |

通过以下路径将 `ConvaiGazeController` 添加到角色： **Convai > Embodiment > Gaze** 该组件使用 SDK 内置的调校参数即可立即生效——无需配置档案资源或进行额外设置，即可在 Play 模式中看到眼神交流效果。

### 它如何决定注视目标

每个帧更新时，Gaze 会从可用候选对象中确定目标，根据角色的对话状态决定注视目标的专注程度，然后依次移动眼睛、头部和身体来转向目标。 [Gaze 的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/how-gaze-works.md) 介绍目标优先级、眼睛—头部—身体的移动顺序，以及 [对话状态](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/core-concepts/dialogue-state.md) 如何驱动角色投入对话。

### 入门指南

{% content-ref url="/pages/516efa6367dbd72ce53d95eaab31db343afd4757" %}
[Gaze 快速开始](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/quick-start.md)
{% endcontent-ref %}

### 探索 Gaze

#### 快速入门

<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>Gaze 的工作原理</strong><br>目标优先级、眼睛—头部—身体的移动顺序，以及对话状态如何驱动角色投入对话。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/how-gaze-works.md">视线工作原理</a></td></tr><tr><td><strong>Gaze 快速入门</strong><br>将 Gaze 组件添加到角色，在 Play 模式中查看眼神交流效果。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/quick-start.md">Gaze 快速开始</a></td></tr></tbody></table>

#### 配置 Gaze

<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/gaze/configure-eye-contact.md">配置眼神接触</a></td></tr><tr><td><strong>Gaze 目标和提供器</strong><br>将场景物体标记为注视目标，并注册自定义目标源。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/targets-and-providers.md">视线目标与提供器</a></td></tr><tr><td><strong>脚本控制 Gaze</strong><br>使用 GazeAt 和 GlanceAt 从代码控制角色的视线。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/scripted-gaze.md">脚本控制的视线</a></td></tr></tbody></table>

#### 参考

<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>Gaze 配置档案参考</strong><br>ConvaiGazeProfile 中的所有设置组及其默认值。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/profile-reference.md">Gaze 配置文件参考</a></td></tr><tr><td><strong>Gaze 脚本参考</strong><br>ConvaiGazeController 公共 API：读取值、句柄和枚举。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/scripting-reference.md">Gaze 脚本参考</a></td></tr><tr><td><strong>Gaze 用法示例</strong><br>训练、访谈和多角色场景。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/usage-examples.md">Gaze 使用示例</a></td></tr><tr><td><strong>排查 Gaze 问题</strong><br>眼睛不动、头部不转，以及目标始终未被选中的问题。</td><td><a href="https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/troubleshooting.md">排查视线问题</a></td></tr></tbody></table>

### 后续步骤

Gaze 是五个具身化模块之一。接下来添加 Body Animation，为同一角色提供待机动作、手势和由 NavMesh 驱动的移动，让 Gaze 能观察并作出反应。

{% content-ref url="/pages/0b1c3a81efd9a912ae49879579642543fed05640" %}
[身体动画](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation.md)
{% endcontent-ref %}

{% content-ref url="/pages/592c2c480eec89e08874079462467e5bb5798a89" %}
[具身化](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment.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/gaze.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.
