> 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 内置调校上生效——无需配置文件资源或额外设置，就能在播放模式中看到眼神接触。

### 它如何决定看向什么

每一帧，Gaze 都会从可用候选项中解析出一个目标，根据角色的对话状态决定要多强地专注于它，并按眼睛、头部、身体的顺序移动到该目标。 [Gaze 的工作方式](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/how-gaze-works.md) 涵盖目标优先级、先眼睛后头部再到身体的移动链，以及如何 [对话状态](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/core-concepts/dialogue-state.md) 驱动参与感。

### 从哪里开始

{% content-ref url="/pages/516efa6367dbd72ce53d95eaab31db343afd4757" %}
[Gaze 快速开始](/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="/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 组件添加到角色中，并在播放模式下查看眼神接触效果。</td><td><a href="/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="/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="/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="/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="/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="/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="/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="/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" %}
[身体动画](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/body-animation.md)
{% endcontent-ref %}

{% content-ref url="/pages/592c2c480eec89e08874079462467e5bb5798a89" %}
[具身化](/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.
