> 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/unity-plugin-beta-overview/mixed-reality-ai-characters-with-vision-meta-quest.md).

# 借助 Vision 的混合现实 AI 角色（Meta Quest）

{% hint style="info" %}
**前提条件：**

* 已转换为 Android 构建目标的 Unity URP 项目
* 已安装并验证可正常工作的 Convai Unity SDK
* 用于部署的 Meta Quest 3 或 Pro 设备

如果你还没有设置 Convai SDK，请先从 [Unity SDK 安装指南](https://docs.convai.com/api-docs/plugins-and-integrations/unity-plugin-beta-overview/getting-started) 后再继续。
{% endhint %}

### 所需包

此设置需要三个包：

| 包                   | Git URL                              |
| ------------------- | ------------------------------------ |
| Convai Unity SDK    | `com.convai.convai-sdk-for-unity`    |
| Meta MR Utility Kit | `com.meta.xr.mrutilitykit@85`        |
| OVR Interaction     | `com.meta.xr.sdk.interaction.ovr@85` |

Meta MR Utility Kit 会自动将 XR Core SDK 作为依赖项安装。你无需单独安装它。

### 步骤 1 — 安装 MR 包

<figure><img src="/files/7a701fabf85536677a92a95c920f9d2bf5c71ea7" alt=""><figcaption></figcaption></figure>

1. 前往 **窗口 > 包管理器**.
2. 点击 **+** 图标并选择 **从 Git URL 安装包**.
3. 粘贴 **Meta MR Utility Kit** 包名并让它安装。这也会自动安装 XR Core SDK。
4. 重复此过程以安装 **OVR Interaction** 包。

安装后你可能会看到一些警告。可以安全忽略这些警告。

***

### 步骤 2 — 将项目转换为 XR

<figure><img src="/files/df87698a3f4115300e63682c524bc59fb9943696" alt=""><figcaption></figcaption></figure>

1. 前往 **文件 > 构建配置 > 玩家设置 > XR 插件管理** 并点击 **安装**.
2. 当提示选择插件提供程序时，选择 **OpenXR**.
3. 当被要求启用 **Meta XR 功能集**时，选择 **是**.
4. 单击 **修复** 对出现的任何警告消息。
5. 在 OpenXR 设置下，添加以下交互配置文件：
   * Meta Quest Touch Pro
   * Meta Quest Touch Plus
6. 启用 **Meta Quest 支持**.
7. 移除 **Quest** 是位于 **Quest 2** 从目标设备列表中。

***

### 步骤 3 — 为透视模式配置场景

<figure><img src="/files/5c561f449f90d1fe9e52eb887528d94766727576" alt=""><figcaption></figcaption></figure>

默认的 Convai 示例场景使用 Unity 摄像机和环境对象，这与 Meta 的透视摄像机装置冲突。请在添加 MR 构建模块之前禁用这两者。

1. 在层级视图中，导航到 **Convai > Camera** 并取消勾选 **检查器**.
2. 对 **环境** 下的摄像机组件也这样做。
3. 前往 **Meta Quest Tools > Building Blocks**.
4. 在 **Core** 筛选器下，添加 **Camera Rig** 是位于 **Passthrough**.
5. 在 **Passthrough** 筛选器下，添加 **透视相机访问** ——这是必需的，因为视觉流必须发送到 Convai 服务器。
6. 出现提示时，点击 **覆盖**.

{% hint style="info" %}
如果添加摄像机装置后你的 Convai 角色不可见，请在层级视图中选中它，并手动更新 **Transform 位置** 数值，直到它在场景视图中正确显示。
{% endhint %}

***

### 步骤 4 — 启用视觉

<figure><img src="/files/ac40fe3e1ecb06dd517d6d610e5dd5e79e974bef" alt=""><figcaption></figcaption></figure>

此步骤将 Meta Quest 透视摄像机连接到 Convai 角色，使其能够看到并响应用户周围的真实世界。

1. 选择 **Convai Manager** 在层级视图中。
2. 将 **连接类型** 到 **视频**.
3. 出现提示时，点击 **添加组件** 以添加 **Convai Vision Publisher** 是位于 **Camera Frame Source**。这些会作为子组件出现在层级视图中的 Convai Manager 下。
4. 默认情况下，Camera Frame Source 使用 Unity 摄像机。请将其替换为 **Quest Vision Frame Source**:
   * 将 **透视相机访问** 对象从层级视图中拖到帧源字段。
5. 单击 **自动查找** 在 **Convai Vision Publisher**.
6. 在 **Camera Rig**内，找到 **Passthrough** 是位于 **摄像机访问** 开关，并确保两者都已启用。

**工作原理：** Convai Vision Publisher 会将来自 Quest 摄像机的实时画面发送到 Convai 服务器。角色接收该画面后，可以实时描述、推理并响应物理对象和空间布局。

***

### 步骤 5 — 为混合现实设置聊天 UI

<figure><img src="/files/7722210d7162301c92721e7ddb81fdfed710b52c" alt=""><figcaption></figcaption></figure>

默认的 Convai 画布 UI 是为平面屏幕构建的。在 MR 场景中，它需要转换为世界空间并缩小，以便自然地位于头显中角色旁边。

1. 选择 **画布** 在层级视图中。
2. 将 **渲染模式** 到 **世界空间**.
3. 将 **位置** 数值为 `0, 0, 0` ，这样它就会显示在玩家前方。
4. 如果 UI 不可见，请将其 **Alpha** 值设为 `1`.
5. 更改画布的 **缩放** 来自 `1` 到 `0.001` ——这会将其调整到头显内可读的大小。
6. 重新定位 **状态容器**, **录制预制件**，以及 **设置预制件** 到角色左侧。
7. 略微倾斜，以匹配头显内自然的观看角度。
8. 在场景视图中调整位置数值，直到布局在角色旁边看起来合适。

{% hint style="info" %}
你也可以使用 Unity 画布组件以及来自 Meta SDK 的模块，以获得更集成的 UI。上面的数值只是让默认 Convai UI 在头显中正常工作的快速基准。
{% endhint %}

***

### 步骤 6 — 构建并部署到 Meta Quest

<figure><img src="/files/ade558329f2ae3c25fdac1fc5157d59894b8fa32" alt=""><figcaption></figcaption></figure>

1. 前往 **文件 > 构建配置**.
2. 单击 **打开场景列表** 并添加 **Lip Sync 场景**.
3. 单击 **构建**，选择目标文件夹，然后点击 **保存**.
4. 通过 USB 连接你的 Meta Quest 设备。
5. 已构建的应用会出现在头显中的 **未知来源** 中。从那里启动它。

{% hint style="info" %}
添加一个 **Directional Light** 在构建前添加到场景中。现实世界的光照条件差异很大，定向光有助于让角色在不同环境中保持一致的外观
{% endhint %}

#### 测试视觉

进入头显后，通过询问角色它能看到什么来测试视觉连接：

* *“你看到我周围有什么？”*
* *“这个房间里有几把椅子？”*
* *“你能描述一下我桌子上有什么吗？”*

角色会使用 Quest 透视摄像机画面实时描述物理环境。

### 组件参考

| 组件                          | 角色                                   |
| --------------------------- | ------------------------------------ |
| `Convai Vision Publisher`   | 将摄像机画面流发送到 Convai 服务器进行处理            |
| `Quest Vision Frame Source` | Meta Quest 专用输入，用透视画面替换默认的 Unity 摄像机 |
| `透视相机访问`                    | 赋予应用访问 Quest 透视摄像机的 Meta 构建模块        |
| `Camera Rig`                | 用于 XR 的、替代标准 Unity 摄像机的 Meta 构建模块    |


---

# 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:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/unity-plugin-beta-overview/mixed-reality-ai-characters-with-vision-meta-quest.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
