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

# Gaze 快速开始

将 Gaze 模块添加到现有 Convai 角色，并确认它在 Play 模式下立即与玩家进行眼神接触。

添加 `ConvaiGazeController` 到一个现有的 Convai 角色上，并确认它在播放模式下会与玩家进行眼神接触。等你已经有一个可正常工作的 `ConvaiCharacter` 位于你的场景中，并且想在调整其任何设置之前先查看 Gaze 是否正在运行。

### 前提条件

* 一个 `ConvaiCharacter` 在你的场景中已经可以连接并响应的——完整 [验证你的设置](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/getting-started/validate-your-setup.md) 如果还没有，请先这样做。
* 一个带有可解析头骨骼的 rig：一个 **Humanoid** rig 会自动解析，而 Generic 或不带动画器的 rig 在你添加一个 [角色 rig 绑定](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/character-rig-setup.md) 并至少分配头部。

{% hint style="info" %}
Gaze 不需要一个 `ConvaiGazeProfile` 资源即可工作。仅添加该组件就会使用 SDK 内置的调优来运行它——配置文件是用于之后重塑行为的，不是用来开启该模块的。
{% endhint %}

### 添加 Gaze 组件

{% stepper %}
{% step %}

#### 选择角色

在层级中，选择 `游戏对象` 所携带的 `ConvaiCharacter` 组件上。
{% endstep %}

{% step %}

#### 添加 Gaze 组件

在检查器中，选择 **添加组件**，然后 **Convai > 具身化 > Gaze**。这会添加 `ConvaiGazeController` 到角色上。

Convai 还会自动添加该模块所需的基础设施——一个 `EmbodimentContext`下方，有一个 `StandardRigBinding`，以及内部的 `GazeAttentionRequests` 控制器所需的组件——会自动添加。你无需自行添加其中任何一个。
{% endstep %}

{% step %}

#### 检查就绪状态

“ `ConvaiGazeController` 检查器会报告该组件是否可以运行： **就绪** 表示 Gaze 已解析出头骨骼，并且在你按下播放时就会正常工作。 **无法工作** 仅在该 rig 没有可供 Gaze 旋转的头骨骼时出现，且检查器会指出修复方法。
{% endstep %}
{% endstepper %}

### 验证设置

进入播放模式并与角色开始对话。Gaze 的默认眼神接触模式是 `自然`，它会跟随角色的对话状态：角色在 `空闲`期间会专注保持眼神接触 `关注中`, `倾听中`以及 `说话中`，并在 `思考中`期间短暂中断接触以进行思考。 在对话过程中移动到角色身后，它就会转身面对你。

{% hint style="success" %}
**预期结果：** 对话开始后不久，角色的眼睛和头部会转向你，在你说话以及它回应时保持眼神接触；如果你在对话中移动到它身后，角色会转身面对你。
{% endhint %}

### 故障排查

如果角色的眼睛和头部没有移动，请打开 `ConvaiGazeController` 检查器，并先检查就绪状态—— **无法工作** 会直接指出缺失的骨骼。如果状态显示 **就绪** 但在播放模式下没有任何移动，请查看 [排查 Gaze 故障](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/troubleshooting.md) 以了解其余的故障模式。

### 下一步

{% content-ref url="/pages/adea0a04a9b4030ac04e68f9303f887133a23c5b" %}
[视线工作原理](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/how-gaze-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/3e45c80fb1153e604c743a1f3a0a835d39719b0e" %}
[配置眼神接触](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/configure-eye-contact.md)
{% endcontent-ref %}

{% content-ref url="/pages/beb7fd6775b7e9b4da287a76d337e2f0e2a2b17f" %}
[排查视线问题](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/embodiment/gaze/troubleshooting.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/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.
