> 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).

# 从玩家视角描述对象

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

默认情况下，聊天机器人收到的每一条空间信息都以聊天机器人自身的参照系来表述——“木箱就在附近，在你前方”意思是相对于角色的前方。 **从玩家视角描述** 会额外添加一个从玩家参照系出发的第二个分句，因此角色可以告诉玩家某物相对于玩家自身视角的位置，而无需自己进行旋转换算。本指南会开启该分句，并向你展示如何在叠加层中确认它。

### 先决条件

* 项目已启用空间感知——参见 [空间感知快速入门](/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 调试覆盖层](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unreal-engine-plugin/troubleshooting/convai-debug-overlay.md) 使用 **Ctrl+Alt+K**，并选择一个已具有 `bReceiveSurroundings` 开启。

查看 **周围环境** 玩家附近某个对象的面板。该行的句子现在应包含两个分句：先是聊天机器人自身的参照系，随后是“From `<Player>`’s position, ...” 分句。将玩家移动到相对于该对象的不同位置，并确认第二个分句会在下一次轮询时更新。

### 下一步

{% content-ref url="/pages/7e106191f2eaa9dd6a1b3cfbbbf3a7e6e171e3bf" %}
[空间感知的工作原理](/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" %}
[空间感知设置参考](/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 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/spatial-awareness/describe-from-player-perspective.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.
