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

# 排查空间感知问题

修复角色什么都不描述、把对象隐藏在墙后、把所有东西都读作很远，或混淆重复对象名称的问题。

使用此页面诊断并修复最常见的空间感知问题。每个条目都按“症状 / 原因 / 修复方法 / 验证”结构编写。

{% hint style="info" %}
如果尚未完成基础设置，请先查看 [空间感知快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/spatial-awareness-quick-start.md) 只有在特定症状仍然存在时，再返回此页面。
{% endhint %}

### 角色完全不描述周围环境

**症状：** 在 **周围环境** 中，Convai 调试叠加层的面板对于选中的聊天机器人始终为空，即使附近有 `UConvaiObjectComponent` Actor 也是如此。

**原因：** 可能是以下情况之一：

* **启用空间感知** (`bEnableSpatialAwareness`) 在 **编辑 > 项目设置 > 插件 > Convai > 空间感知** 中处于关闭状态——这是总开关。关闭时，不会为任何聊天机器人生成事实信息。
* 附近对象的 `UConvaiObjectComponent` 的 **已启用** (`bConvaiEnabled`) 未勾选，或者 **纳入空间感知** (`bIncludeInSpatialAwareness`) 未勾选。任一情况都会将该对象单独排除在空间感知之外，不影响系统的其他部分。
* 聊天机器人自身的 **接收周围环境信息** (`bReceiveSurroundings`) 在 **Convai | 空间感知** （高级显示）中处于关闭状态，该设置位于 `UConvaiChatbotComponent`.

**修复方法：**

1. 检查 **启用空间感知** 是否已在 **编辑 > 项目设置 > 插件 > Convai > 空间感知**.
2. 中开启。选中对象的 `UConvaiObjectComponent` 并确认 **已启用** 和 **纳入空间感知** 均已勾选。
3. 选中聊天机器人的 `UConvaiChatbotComponent`，展开 **Convai | 空间感知**，并确认 **接收周围环境** 已勾选。

**验证：** 进入运行模式，打开 [Convai 调试叠加层](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md)，选择聊天机器人，并确认对象对应的行出现在 **周围环境**.

***

### 仍会描述墙后的对象

**症状：** 聊天机器人描述了一个它本不应能看到的对象，例如实心墙另一侧的对象。

**原因：** **启用视线检测** (`bEnableLineOfSight`）默认未勾选。关闭此选项时，无论观察者和对象之间有什么遮挡，系统都会描述每个对象。

**修复方法：** 在 **编辑 > 项目设置 > 插件 > Convai > 空间感知**中，勾选 **启用视线检测**。每次轮询时，这会为每一对聊天机器人和对象执行一次线迹检测，因此仅在项目能够接受相应开销时启用。

**验证：** 进入运行模式，将聊天机器人放置在墙后，使墙挡住它对已注册对象的视线，并确认对象对应的行从 **周围环境** 中的 [Convai 调试叠加层](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md).

***

### 所有对象都显示为“很远”

**症状：** 周围环境文本中，关卡里的所有对象都显示为“很远”，包括距离聊天机器人很近的对象。

**原因：** **近距离** 和 **中等距离** 以厘米为单位设置，默认值分别为 `1000.0` 厘米和 `4000.0` 厘米。若关卡采用不同的比例（例如房间大得多，或地图按车辆尺寸设计），即使对象看起来很近，也可能都超过 `ModerateDistance` 。

**修复方法：** 在 **编辑 > 项目设置 > 插件 > Convai > 空间感知**中，增大 **近距离** 和 **中等距离** 的值，使其符合关卡的比例。确保 **中等距离** 大于 **近距离** ；系统不会验证这两个值之间的大小关系。

**验证：** 进入运行模式，将聊天机器人放在已注册对象附近，并确认该对象对应的行出现在 **周边环境** 显示为“近处”或“有一定距离”，而不是“很远”。

***

### 未显示物体之间的关系

**症状：** 对单个物体的描述会出现在 **周边环境**中，但聊天机器人从不提及两个物体之间的关系（例如，“枪在箱子上面”）。

**原因：** 可能是以下情况之一：

* **启用关系** (`bEnableRelations`) 在以下位置处于关闭状态： **Edit > Project Settings > Plugins > Convai > Spatial Awareness**.
* 两个物体之间的距离超过了 **关系聚类距离** (`RelationClusterDistance`，默认值为 `600.0` 厘米）。
* 聊天机器人的 **接收关系** (`bReceiveRelations`) 在以下位置处于关闭状态： **Convai | Spatial Awareness** 位于 `UConvaiChatbotComponent`.

**修复方法：**

1. 检查 **启用关系** （位于 **Edit > Project Settings > Plugins > Convai > Spatial Awareness**.
2. 将物体移近，使距离小于 **关系聚类距离**，或增大该距离以涵盖这些物体。
3. 选中聊天机器人的 `UConvaiChatbotComponent` 并确认 **接收关系** 已勾选。

**验证：** 进入运行模式，确保两个相关物体之间的距离小于 **关系聚类距离** ，并确认出现了它们之间的关系事实——检查 **事实** 中的 [Convai 调试叠加层](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md).

***

### 重复的物体名称会让角色困惑

**症状：** 聊天机器人称呼了错误的箱子，或者其回复表明它无法区分两个名称相同的物体。

**原因：** 可能是以下情况之一：

* 这些物体本应能彼此区分，但 **重复名称后缀样式** (`ObjectNameSuffixStyle`) 生成的后缀未被 AI 正确使用——请检查设置的样式（`Numeric` 或 `Alphabetical`) 下的 **Edit > Project Settings > Plugins > Convai > Objects**.
* 这些对象应被视为同一类事物——一堆相同的道具——但 **Merge With Same-Named Objects** 在它们的 `UConvaiObjectComponent`上处于关闭状态，因此它们仍会添加后缀并被单独寻址，而不是合并在一起。

**修复方法：**

* 若要让这些对象保持独立，请确认 **Duplicate Name Suffix Style** 生成的名称符合预期；在编写必须针对某个特定对象的操作或对话脚本时，请使用对象完整的后缀名称（例如 "Crate 2"）来引用它。
* 若要将这些对象视为同一类事物，请在每个对象上启用 **Merge With Same-Named Objects** ——请参阅 [合并同名对象](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/merge-same-named-objects.md).

**验证：** 进入 Play 模式，打开 [Convai 调试叠加层](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md)，并确认 **周围环境** 显示的内容符合预期：对象各自独立时，每个对象对应一行带后缀的记录；对象合并时，则显示一条合并记录。

***

### 空间文本过长

**症状：** 发送给 Convai 的上下文明显比预期更长，或者聊天机器人的回复表明它收到了重复的位置信息。

**原因：** **Describe From Player Perspective** (`bDescribePlayerPerspective`) 会为每条空间事实增加第二个分句，使其长度大致翻倍。此选项默认已勾选。

**修复方法：** 在 **Edit > Project Settings > Plugins > Convai > Spatial Awareness**下，取消勾选 **Describe From Player Perspective** ，如果你的聊天机器人不需要从玩家自身的视角为玩家指路。有关启用该选项后新增的分句，请参阅 [从玩家视角描述对象](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/describe-from-player-perspective.md) 。

**验证：** 进入 Play 模式，打开 [Convai 调试叠加层](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md)，并确认 **周围环境** 中的每一行现在只显示聊天机器人自身的参照系，不再包含“From `<Player>` 的位置，...”分句。

***

### 后续步骤

{% 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/280824f0950858984da0cf561a8148bbd7eee0e8" %}
[空间感知快速开始](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/spatial-awareness-quick-start.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/troubleshoot-spatial-awareness.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.
