> 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-unreal-engine-plugin/features/gaze-attention/gaze-attention-quick-start.md).

# 凝视注意力快速入门

在……上启用凝视注意 `UConvaiPlayerComponent`，将一个世界中的 Actor 标记出来，使其能够接收注意力，并在玩家将视线停留在其上后验证 Convai 角色是否识别了该对象。最后，当玩家看向该 Actor 达到 `GazeAttentionDelay` 持续时间（默认：1.0 秒）。

{% embed url="<https://youtu.be/Ffkzgof_wKw>" %}
Convai 对象注意力操作指南
{% endembed %}

### 先决条件

在启用凝视注意之前，请确认以下内容：

* Convai Unreal Engine 插件已安装且 API 密钥已配置。请参阅 [安装 Convai 插件](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/getting-started/install-the-convai-plugin.md).
* 你的关卡中包含一个 `UConvaiChatbotComponent` ，用于 AI 角色，以及一个 `UConvaiPlayerComponent` ，用于玩家 Pawn，且具有有效的 `CharacterID` 和可用的麦克风会话。
* **启用动作** 在聊天机器人上已勾选。请在 **大纲**中选择聊天机器人，打开 `UConvaiChatbotComponent` 中的 **详细信息** 面板，展开 **Convai | Actions** → **环境**，并确认 **启用动作** (`bEnableActions`）已开启。凝视注意会写入聊天机器人的注意力槽，这要求在会话连接时动作系统处于活动状态。如果动作尚未设置，请先按照 [角色动作快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/character-actions/character-actions-quick-start.md) 进行。

{% hint style="info" %}
如果你还没有标记任何世界对象，请先完成 [场景元数据快速入门](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/scene-metadata-quick-start.md) 再继续。凝视注意至少需要一个 `UConvaiObjectComponent` ，其 **名称**.
{% endhint %}

### 启用凝视注意并标记对象

{% stepper %}
{% step %}

#### 选择玩家 Pawn

在 **大纲** （或者在 **内容浏览器**中，如果正在编辑蓝图），打开持有 `UConvaiPlayerComponent`.
{% endstep %}

{% step %}

#### 打开总开关

选择 `UConvaiPlayerComponent` 中的 **详细信息** 面板。在 **Convai | Gaze Attention**下，勾选 **启用凝视注意** (`bEnableGazeAttention`）。默认值为 `false`；在此开启之前，其他所有凝视设置都会保持灰显。
{% endstep %}

{% step %}

#### 设置响应模式

将 **凝视应响应** (`GazeShouldRespond`）设置为 `始终`。默认值为 `从不`，它会静默更新注意力槽，而不会请求角色口头回复。

在 **凝视注意文本** (`GazeAttentionText`中，输入一句简短的话，例如 `“玩家正在看着这个对象。”`。Convai 会在注意力提升时将此文本作为叙事事件使用。
{% endstep %}

{% step %}

#### 标记一个世界 Actor

点击关卡中的任意道具——箱子、门或设备部件。在 **详细信息** 面板中，点击 **添加组件** 并搜索 **Convai Object Component**。选择它以添加一个 `UConvaiObjectComponent`.

展开 **Convai | Object** 并设置：

* **名称** — 一个简短标签，例如 `“SafetyValve”`.
* **描述** — 一句描述，例如 `“西墙上的红色紧急阀门。”`

在 **Convai | Object | Gaze**下，确认 **可凝视** (`bGazeable`）已勾选。当 `bGazeable` 为 `false`false 时，该对象会完全从凝视管线中排除。
{% endstep %}

{% step %}

#### 进入游戏模式并看向该对象

按 **播放**。将准星对准已标记的 Actor 并保持不动。

你应该会看到三个反馈阶段：

1. **立即** —— 对象上会出现视觉高亮（UE 5.3+ 为淡黄色覆盖层，UE 5.0–5.2 为线框框），且中心光标点会变为白色。
2. **在 `GazeAttentionDelay` 秒后** （默认 1.0 秒）—— `OnAttentionGained` 会触发，聊天机器人的注意力槽会更新。
3. **随后不久** —— 角色开始说话，因为 `GazeShouldRespond` 已设置为 `始终`.
   {% endstep %}
   {% endstepper %}

{% hint style="success" %}
当凝视注意正常工作时：准星一进入对象，物体就会立即出现高亮，光标点变为白色，并且——在保持凝视 `GazeAttentionDelay` 秒后——角色开始说出响应。
{% endhint %}

如果高亮从未出现，请参阅 [排查凝视注意问题](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/gaze-attention/troubleshoot-gaze-attention.md)。如果高亮出现但角色保持沉默，请确认 **启用动作**, `GazeShouldRespond`，以及 `GazeAttentionText` 在玩家组件上。

### 后续步骤

{% content-ref url="/pages/d8a57f062e27764c8ec780df8b4e07d5b4d4282b" %}
[凝视注意力如何工作](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/gaze-attention/how-gaze-attention-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/797ae18ef94bcef2ec7816f079c7a35fb212a26c" %}
[凝视注意力参考](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/gaze-attention/gaze-attention-reference.md)
{% endcontent-ref %}

{% content-ref url="/pages/2f301cf695f654f0b6dc66672ff9462854021237" %}
[凝视注意力使用示例](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/gaze-attention/gaze-attention-usage-examples.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-unreal-engine-plugin/features/gaze-attention/gaze-attention-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.
