> 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 > 具身化 > Gaze** 而且它会立即基于 SDK 内置调校工作——无需配置文件资源或额外设置，就能在 Play 模式中看到目光接触。

### 它如何决定看什么

每个 tick，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>注视的工作方式</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>凝视快速入门</strong><br>将 Gaze 组件添加到角色中，并在 Play 模式下查看目光接触如何工作。</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>脚本化注视</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>注视配置参考</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>注视脚本参考</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 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/gaze.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.
