> 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/spatial-awareness/spatial-awareness-quick-start.md). Agents can also search and read this documentation through its [MCP server](https://docs.convai.com/api-docs/~gitbook/mcp).

# 空间感知快速开始

开启空间感知，针对关卡尺度调整距离带，并确认角色实际接收到什么。

本指南将为项目启用空间感知，调整距离范围以适配关卡的规模，并通过 Convai 调试叠加层确认聊天机器人确实收到了系统生成的句子。

### 前提条件

* 已安装 Convai Unreal Engine 插件。
* 关卡中至少放置了一个 `UConvaiChatbotComponent` 。
* 关卡中至少还有一个其他 Actor 带有 `UConvaiObjectComponent`，这样聊天机器人就有内容可供了解。

### 确认主开关已开启

{% stepper %}
{% step %}

#### 打开项目设置

转到 **Edit > Project Settings > Plugins > Convai** 并展开 **空间感知** 类别。
{% endstep %}

{% step %}

#### 确认已勾选“启用空间感知”

**启用空间感知** (`bEnableSpatialAwareness`）默认处于勾选状态。如果未勾选，项目中的所有聊天机器人都不会生成邻近度、视线或关系事实——现在请勾选此项。
{% endstep %}
{% endstepper %}

### 根据关卡规模调整距离范围

空间感知使用两个以厘米为单位的阈值，将聊天机器人可以感知到的每个对象划分为“近处”“有些距离”或“远处”。默认值适用于人类尺度的关卡；规模大得多或小得多的关卡需要使用不同的值。

{% stepper %}
{% step %}

#### 设置近距离

**近距离** (`NearbyDistance`，默认值为 `1000.0` 厘米）是将对象判定为“近处”的上限。将其设为一个大致范围，使关卡中的角色可以把该范围内的事物视为触手可及或几步之遥。
{% endstep %}

{% step %}

#### 设置中距离

**中距离** (`ModerateDistance`，默认值为 `4000.0` 厘米）是将对象判定为“有些距离”的上限。超过此距离的对象将被判定为“远处”。请确保 `ModerateDistance` 大于 `NearbyDistance` ——系统不会替你强制执行这两个值的顺序。
{% endstep %}
{% endstepper %}

{% hint style="info" %}
这两个距离设置都受编辑条件 `bEnableSpatialAwareness`控制，因此在主开关开启前会显示为灰色。
{% endhint %}

### 确认聊天机器人已设置为接收周围环境信息

上述项目设置决定空间系统计算哪些信息；每个聊天机器人的自身偏好则决定它实际接收哪些信息。

{% stepper %}
{% step %}

#### 选择聊天机器人的 Convai 聊天机器人组件

在角色蓝图或关卡 Actor 中，选择 `UConvaiChatbotComponent`.
{% endstep %}

{% step %}

#### 确认“接收周围环境信息”已开启

展开 **Convai | 空间感知** （高级显示），并确认 `bReceiveSurroundings` 已勾选。其默认值为 `true`。如果此项关闭，无论上述项目设置如何，该聊天机器人都不会收到周围环境信息。
{% endstep %}
{% endstepper %}

### 验证角色接收到的内容

进入 Play 模式，打开 [Convai 调试叠加层](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md) 按下 **Ctrl+Alt+K**，然后选择聊天机器人。

查看 **周围环境** 面板，找到带有 `UConvaiObjectComponent` 的对象（该对象已在前置准备中添加）。对应行会显示聊天机器人实际接收到的句子，例如：“箱子就在附近，在你前方。”这就是发送给 Convai 的确切文本，而非摘要，因此是确认距离区间调整是否生成预期措辞的最快方法。

{% hint style="success" %}
如果该行显示对象处于错误的距离区间，请调整 `NearbyDistance` 或 `ModerateDistance` 然后重新进入 Play 模式，即可立即查看变化。
{% endhint %}

有关叠加层显示的所有面板、图标和标签，请参阅 [Convai 调试叠加层参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay-reference.md).

### 后续步骤

{% content-ref url="/pages/7e106191f2eaa9dd6a1b3cfbbbf3a7e6e171e3bf" %}
[空间感知的工作原理](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/how-spatial-awareness-works.md)
{% endcontent-ref %}

{% content-ref url="/pages/61357e0f0cdf694475bb5b1ab006fa4ae40d02e2" %}
[空间感知设置参考](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/spatial-awareness-reference.md)
{% endcontent-ref %}

{% content-ref url="/pages/7ae0cd173a36a87a1546f41623ce3ca4da2a289b" %}
[排查空间感知问题](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/troubleshoot-spatial-awareness.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/spatial-awareness/spatial-awareness-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.
