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

# 场景元数据快速开始

用 Convai Object Component 标记一个世界 Actor，分配其名称和描述，并确认 Convai 角色可以在对话中引用它。

将一个 `UConvaiObjectComponent` 附加到世界中的 `Actor`，为其命名并添加描述，然后测试 Convai 角色能否在对话中将该对象用作场景上下文。

### 前提条件

* 已安装 Convai Unreal Engine 插件并配置 API 密钥。
* 关卡中有一个 `UConvaiChatbotComponent` 和一个 `UConvaiPlayerComponent` ，并且具有有效的 Character ID 和可正常工作的麦克风。若尚未完成此设置，请参阅 [添加你的第一个 Convai 角色](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/getting-started/add-your-first-convai-character.md) 。

### 公开 Actor 并验证识别结果

{% stepper %}
{% step %}

#### 选择目标 Actor

打开关卡，然后单击你希望 Convai 角色了解的 `Actor` ，例如门、箱子或杠杆。
{% endstep %}

{% step %}

#### 添加对象组件

在 **细节** 面板中，单击 **添加组件** 并搜索 `UConvaiObjectComponent` 或 `Convai Object`。选择该组件，将其添加到 `Actor`.
{% endstep %}

{% step %}

#### 设置对象名称和描述

选中 **Convai Object Component** 后，在 **细节** 面板中设置对象标识字段：

* **`Name`** — 简短且唯一的标签，例如 `FrontDoor`.
* **`Description`** — 用简单句子描述对象，例如 `A large wooden door at the main entrance.`

关卡中的名称必须唯一。有关重复项处理方式和完整字段列表的详情，请参阅 [场景元数据组件参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/scene-metadata-component-reference.md) 。
{% endstep %}

{% step %}

#### 进入 Play 模式并向角色提问

按下 **播放**。走到 Convai 角色旁边并提问： `"What do you know about the door?"` 或 `"描述你附近的物体。"` 角色应该会提到你设置的名称和描述。

如果角色没有提及该物体，请打开 **输出日志** 并筛选 `ConvaiSubsystemLog` 以查找注册警告，或筛选 `ConvaiObjectComponentLog` 以查找组件警告。有关症状的完整列表，请参阅 [排查场景元数据问题](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/troubleshoot-scene-metadata.md) 。
{% endstep %}

{% step %}

#### 添加跟踪属性（可选）

若要让角色感知实时游戏状态，请展开 **跟踪属性** （位于“细节”面板中），然后点击 **+** 添加一行。点击 **绑定** （位于 **属性路径** 旁），然后选择一个 `UPROPERTY` （来自 `Actor`）。设置通俗易懂的 **`Description`** ，并选择 **`ShouldRespond`** 值。

有关跟踪属性的完整工作流程，请参阅 [场景元数据组件参考 — 跟踪属性](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/scene-metadata-component-reference.md#tracked-properties).
{% endstep %}
{% endstepper %}

{% hint style="success" %}
正确配置后，角色会使用你设置的名称和描述来回答有关该物体的问题。
{% endhint %}

{% hint style="info" %}
有关此组件可用属性和函数的完整列表，请参阅 [场景元数据组件参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/scene-metadata-component-reference.md).
{% endhint %}

### 后续步骤

{% content-ref url="/pages/5b34043c604b8f8fd8088c66f01ea7887fcd8846" %}
[场景元数据组件参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/scene-metadata-component-reference.md)
{% endcontent-ref %}

{% content-ref url="/pages/4a8ee50a93a78b9b86484cb79897f6d0d6bde187" %}
[运行时管理环境](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/managing-the-environment-at-runtime.md)
{% endcontent-ref %}

{% content-ref url="/pages/35be910ed18e7f78411fd4d732770d70307e1434" %}
[排查场景元数据问题](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/scene-metadata/troubleshoot-scene-metadata.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-unreal-engine-plugin/features/scene-metadata/scene-metadata-quick-start.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.
