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

# 从玩家视角描述对象

让角色从玩家自己的相机视角而不是自身视角来描述周围环境，从而可以给出方向。

默认情况下，聊天机器人收到的每条空间事实都以聊天机器人自身的坐标系来描述——“箱子就在附近，在你前面”指的是角色前方。 **从玩家视角描述** 会额外添加一个以玩家坐标系描述的子句，让角色无需自行计算旋转，就能告诉玩家某个物体相对于玩家自身视角的位置。本指南将启用该子句，并说明如何在叠加层中确认效果。

### 前提条件

* 项目已启用空间感知——请参阅 [空间感知快速入门](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/features/spatial-awareness/spatial-awareness-quick-start.md).
* 玩家 `UConvaiPlayerComponent` 已添加到玩家 Pawn 上，因此可以基于玩家摄像机坐标系进行描述。

### 此设置的作用

`bDescribePlayerPerspective` 是 `UConvaiSettings` 中的项目级设置——它适用于每个聊天机器人的周围环境事实，而不是单独针对某个角色。启用后，每条事实都会附带一个额外子句，明确指出玩家及方向，例如：

> “从 Eshmawy 的位置看，箱子就在附近，前方偏左。”

玩家视角子句不会因距离而省略：即使目标很远，该子句也会将描述降级为单纯的“很远”，而不会将其省略。因此玩家离开后，先前“就在附近”的描述不会作为过时信息继续保留。

### 启用“从玩家视角描述”

{% stepper %}
{% step %}

#### 打开“空间感知”设置

前往 **编辑 > 项目设置 > 插件 > Convai** 并展开 **空间感知** 类别。
{% endstep %}

{% step %}

#### 勾选“从玩家视角描述”

**从玩家视角描述** (`bDescribePlayerPerspective`）默认处于勾选状态。如果项目中已将其关闭，请现在勾选。此设置的编辑条件为 `bEnableSpatialAwareness`，因此必须先启用总开关。
{% endstep %}
{% endstepper %}

{% hint style="warning" %}
此子句会使传递给每个聊天机器人的空间文本长度大致增加一倍。对于不需要为玩家指路的角色，请将其关闭。
{% endhint %}

### 在 Convai 调试叠加层中验证

进入游戏运行模式，按 [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**）打开叠加层，然后选择一个已启用 `bReceiveSurroundings` 的聊天机器人。

查看 **周围环境** 面板中靠近玩家的物体。该行的描述现在应包含两个子句：先是聊天机器人自身坐标系的描述，然后是“从 `<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 %}


---

# 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/describe-from-player-perspective.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.
