> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-zh/chang-jing-bian-ji-qi/jiao-hu-xing/modifier-areas.md).

# 修饰区域

在 Scene Editor 中使用修饰区域来改变头像行为，或在你场景的某个区域内强制使用特定摄像机模式。

修改器区域是一些不可见的区域，会改变玩家体验场景中部分内容的方式。它们有两种类型：

* **头像修改区域**：改变区域内玩家的虚拟形象行为或外观，例如隐藏虚拟形象或禁用个人资料弹窗。
* **摄像机修改区域**：在玩家处于该区域内时，强制其摄像机切换为第一人称或第三人称。

当玩家走出区域时，这两种类型都会恢复为正常行为。

## 添加修改器区域

你可以通过两种方式添加修改器区域：

**从资产目录：** 打开资产目录并搜索 **头像修改区域** 或 **摄像机修改区域** 在 **Utils** 类别。将其拖入场景。该项目会以半透明的占位立方体形式出现，只在编辑器中可见，在运行中的场景里不可见。

**从组件菜单：** 选择任意现有实体，点击属性面板顶部的 **+** 按钮，然后从列表中选择 **头像修改区域** 或 **摄像机修改区域** 。请参见 [添加组件](/creator/content-creator-zh/chang-jing-bian-ji-qi/gou-jian/components.md#add-components) 了解更多详情。

![在名为 Stage area 的实体上打开的添加组件菜单，列出 3D 内容和交互组下的组件，包括 Avatar Modifier Area 和 Camera Modifier Area。](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-6a35142910f0343c27340673c61d75ed5f75f05a%2Fadd-component.png?alt=media\&token=a3fb4e60-b24d-4e2a-b9b8-45d7db23aee0)

## 调整区域大小

修改器区域的大小由实体的 **Transform 缩放值**控制。如果你将实体缩放为 4 x 3 x 4，修改器区域就会变成一个以实体位置为中心的 4 x 3 x 4 米立方体。可使用缩放控制柄，或在 Transform 组件中输入精确值来设置所需尺寸。

{% hint style="warning" %}
**注意：** 编辑器面板中没有单独的“区域”字段。编辑器会自动将内部的 area 属性与实体的缩放保持同步，所以你只需要调整实体大小即可。
{% endhint %}

## 头像修改区域

Avatar Modifier Area 面板有两个设置项：

![Avatar Modifier Area 组件面板，Modifiers 下拉菜单中已选择 Hide Avatars，下面有 Exclude Player IDs 部分和 Add Player ID 按钮。](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-43c3143c3e75e9ead736fcab3199e6eabeb53d1d%2Favatar-modifier-area-component.png?alt=media\&token=d81790d6-c6ab-4736-8eeb-15a1c1e887fd)

### 修改项

一个可多选的下拉菜单，包含以下选项：

* **隐藏虚拟形象**：区域内的虚拟形象会变得不可见。区域内的玩家彼此看不到对方，但区域外的玩家仍会正常看到他们。
* **禁用个人资料弹窗**：点击区域内玩家的虚拟形象将不再打开其个人资料弹窗。

你可以在同一个区域中选择一个或两个修改项。添加该组件时， **隐藏虚拟形象** 会被默认选中。点击修改项上的 **x** 即可将其移除。

### 排除玩家 ID

一个钱包地址列表，这些地址不受修改项影响。地址在此列表中的玩家即使身处区域内也会保持正常行为。

点击 **添加玩家 ID** 以添加一条记录，然后粘贴钱包地址。要移除一条，点击其旁边的三点菜单并选择 **移除玩家 ID**.

这在某些活动中很有用，例如你想在舞台上隐藏观众的虚拟形象，但保留表演者可见。

{% hint style="warning" %}
**注意：** 请确保钱包地址为小写。修改器区域使用精确字符串匹配。
{% endhint %}

### 使用场景

* **隐私区域**：在后台或更衣区隐藏虚拟形象。
* **整洁舞台**：在舞台上隐藏观众的虚拟形象，这样只有表演者（列在 Exclude Player IDs 中）可见。
* **游戏竞技场**：在战斗区域禁用个人资料弹窗，这样玩家在游戏过程中就不会误打开个人资料。

## 摄像机修改区域

Camera Modifier Area 面板只有一个设置项：

![Camera Modifier Area 组件面板，Camera Mode 下拉菜单设置为 First Person。](https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-4b25e231dcd2e4d14dfdadf7b942f94e16ad55f4%2Fcamera-modifier-area-component.png?alt=media\&token=4967a8a8-9658-481c-b84e-2de3b2a6bf25)

### 摄像机模式

一个包含两个选项的下拉菜单：

* **第一人称**：在玩家处于该区域内时，强制切换为第一人称视角。
* **第三人称**：在玩家处于该区域内时，强制切换为第三人称视角。

默认值为 **第一人称**。当玩家离开该区域时，会恢复其之前的摄像机模式。

{% hint style="info" %}
**提示：** 这里不支持电影镜头模式。若要控制摄像机超出第一/第三人称切换的范围，请使用一个 [虚拟摄像机](/creator/content-creator-zh/chang-jing-sdk7/3d-nei-rong-ji-chu/camera.md#using-virtual-cameras) 带代码的。
{% endhint %}

### 使用场景

* **狭窄走廊或解谜房间**：强制使用第一人称，便于精确点击小物体。
* **观景点**：强制使用第三人称，让玩家可以在背景前看到自己的虚拟形象。
* **教程区域**：确保所有玩家在引导体验中使用相同的摄像机模式。

## 组合修改器区域

你可以将两种类型的修改器区域放在同一个实体上，或让彼此独立的修改器区域在同一空间重叠。每个区域都会独立生效。

{% hint style="warning" %}
**注意：** 请尽量减少场景中的修改器区域数量。太多会影响性能。对大多数场景来说，少量几个就足够了。
{% endhint %}

## 在代码中使用修改器区域

场景编辑器中的组件与 SDK7 `AvatarModifierArea` 和 `CameraModeArea` 组件直接对应。有关可用修改项、运行时行为以及动态更改排除列表等高级选项的完整详情，请参见：

* [头像修改器区域](/creator/content-creator-zh/chang-jing-sdk7/jiao-hu-xing/tou-xiang/modifier-areas.md) （SDK7）
* [摄像机模式区域](/creator/content-creator-zh/chang-jing-sdk7/3d-nei-rong-ji-chu/camera.md#1st-and-3rd-person-camera-modes) （SDK7）


---

# 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.decentraland.org/creator/content-creator-zh/chang-jing-bian-ji-qi/jiao-hu-xing/modifier-areas.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.
