> 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/gou-jian/spawn-areas.md).

# 生成区域

使用生成区域以可视化方式设置生成位置和生成摄像机位置。

创作者可以在 **生成位置** 和 **生成摄像机目标** 中设置这些选项：在 Creator Hub 中编辑 **生成区域** 实体。

这为创作者提供了一种可视化方式，用于设置生成区域以及化身生成时面朝的方向，就像设置场景中的其他对象一样。

生成区域定义了玩家直接访问场景时出现的位置，无论玩家是输入坐标还是通过传送抵达。场景中可能有树木或楼梯等物体，如果玩家恰好生成在这些物体上方，就可能无法移动；场景中也可能有高低起伏的地形。如果玩家生成在无法移动的位置，体验会很糟糕。因此，你可以选择在特定位置设置一个或多个生成点。

{% hint style="warning" %}
**📔 注意**：所有生成点都必须位于构成场景的地块内。玩家不能生成在这些地块的范围之外。
{% endhint %}

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-8f55fe50aa327315ba25cedbd5490ae195faa84a%2Fspawn-entity-scene-editor.webp?alt=media" alt="" width="200">

生成区域由两个相互配合的不同实体组成：

* **生成** 实体：位于 **玩家** 实体中。用于定义玩家的实际生成点。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-048b04710a5369a469faade3178f39885b1008e8%2Fspawn-entity.webp?alt=media" alt="" width="200">

* **摄像机目标** 实体：位于 **生成区域** 实体中。将其移动到玩家生成时希望面朝的方向。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-d53cbec5b9e2fab2799b80f3f8b237313a48d26a%2Fspawn-camera-entity.webp?alt=media" alt="" width="200">

## 更改生成区域

**生成区域** 及其 **摄像机目标** 可以像场景中的其他对象一样，直接在场景编辑器中移动；也可以手动修改其值（与其他实体中的变换组件类似）。

### 参数

选中生成区域后，创作者可以在“组件”部分查看并设置以下值：

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-36a116fb55417a513f8f9b62c3c14dc7dab435e3%2Fdefault-spawn-point-component.webp?alt=media" alt="" width="600">

* **位置**：化身的生成位置。这些是场景内相对于场景原点的坐标，与变换组件中使用的坐标类似。
* **生成摄像机目标**：化身生成到场景后，摄像机（以及化身）面朝的方向。利用此选项，可以更好地控制玩家进入场景时的第一印象。
* **随机区域**：为生成区域添加随机范围（以米为单位），并可使用 **不随机** 切换开关来启用或停用。启用后，场景编辑器中会显示一个区域，指示玩家可能随机生成的范围。随机偏移会同时应用于 X 轴和 Z 轴，从而防止玩家生成时彼此重叠。在拥挤的场景中，玩家重叠的情况尤其不理想。

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-c6316ddec5f9d5cebf3f08d0c2870349bdb5e39d%2Fspawn-point-randomized.webp?alt=media" alt="" width="600">

## 多个生成区域

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-9a1b22e635fbb9ac735738ba7569f399efff3f5a%2Fspawn-area-multiple-scene-editor.webp?alt=media" alt="" width="600">

创作者可以定义多个 **生成区域** 。要创建新的生成区域，请按以下步骤操作：

1. 选择任意一个生成区域， **spawn1** 为默认区域。
2. 所有生成区域都会显示在右侧面板中。点击 **+ 添加新生成区域**&#x20;

   <img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-57aee05e18517d074ac74472b7d8a9642dacb5c0%2Fspawn-area-add-new.webp?alt=media" alt="图标" width="200">

   .

<img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-18a208b2233f696306118aae8b90876fd4e81c72%2Fspawn-area-multiple-components.webp?alt=media" alt="" width="600">

3. 启用所需生成区域的 **主生成点**&#x20;

   <img src="https://2460066822-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-5778e62e0852bcabe81a858b8c3761a1eb2f9d68%2Fspawn-areas-main-spawn-toggle.webp?alt=media" alt="图标" width="100">

   &#x20;。如果多个生成区域都被切换为 **主生成点**，玩家就会随机出现在其中一个区域。
4. 预览场景。


---

# 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/gou-jian/spawn-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.
