> For the complete documentation index, see [llms.txt](https://wiki.thescriptersguild.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.thescriptersguild.com/knowledge/scripting/bugs/spawn-mode-object-node-in-on-level-brain-doesn-t-work-if-map-loaded-with-a-forge-mode.md).

# Spawn Mode Object Node In On-Level Brain Doesn't Work If Map Loaded With a Forge Mode

A bug has been identified where scripts in an on-level `Mode Brain` that utilize the [Spawn Mode Object](/scripting/nodes/game-mode/spawn-mode-object.md) node fail to clone any object if the map is played via a custom game loaded with a Forge Mode. This even occurs when using Forge Modes constructed from just empty Mode Brains.

## Scripting Behavior and Observed Issues

When playing on an official mode, such as "Arena:Slayer", objects are cloned successfully. However, when running the same map through a Forge Mode (like a custom Minigame), the `Spawn Mode Object` fails to produce any output object. Instead, system logs or killfeeds indicate that the resulting output object is not valid.

<div align="center"><figure><img src="/files/HIAMZIlRBOgRyETcXnFs" alt=""><figcaption></figcaption></figure> <figure><img src="/files/T76pfbv4MIHuJ6FYabCv" alt=""><figcaption></figcaption></figure> <figure><img src="/files/EEIOnyOfyY687B88NXV9" alt=""><figcaption></figcaption></figure> <figure><img src="/files/URwPrWOgBsxIuHEpJmTN" alt=""><figcaption></figcaption></figure> <figure><img src="/files/iQwxrOCawqZmB0W7QQGN" alt=""><figcaption></figcaption></figure> <figure><img src="/files/LHpg34IxpkAMOeq7npAV" alt=""><figcaption></figcaption></figure> <figure><img src="/files/dcYl5M2f8AO1teAE9P0G" alt=""><figcaption></figcaption></figure> <figure><img src="/files/rAEmU1oeO2LpiCEqLgSA" alt=""><figcaption></figcaption></figure> <figure><img src="/files/aXRPAskVQuI655oDQ4rk" alt=""><figcaption></figcaption></figure> <figure><img src="/files/A06RjdE86cD0IfURThGg" alt=""><figcaption></figcaption></figure></div>

### Forge Play Mode vs Arena:Slayer

In testing within Forge Play Mode, the node graph scripts appear to function correctly and print expected values. The failure is specifically tied to loading a map using a saved Forge Mode variant rather than an official game mode.

## Reproduction Steps

#### Option 1

1. Load map [Mode Object spawn issue](https://www.halowaypoint.com/halo-infinite/ugc/maps/8e5803c2-27fc-498e-864c-483304d87990) with official mode "Arena:Slayer", mark the ground and observe the correct behavior where the red Primitive Block gets cloned and the killfeed shows relevant data about the objects.
2. Load map [Mode Object spawn issue](https://www.halowaypoint.com/halo-infinite/ugc/maps/8e5803c2-27fc-498e-864c-483304d87990) with mode [Example Minigame Forge Mode](https://www.halowaypoint.com/halo-infinite/ugc/modes/c38cd73c-5a5e-4582-aa89-50af710edc65), mark the ground and observe the issue behavior where the red Primitive Block doesn't get cloned and the killfeed shows that the output object is not a valid object.

#### Option 2

1. Load into Forge on an empty Void canvas and place a Primitive Block and a Mode Brain.
2. Give the Primitive Block a Spawn Order of 50 and give the Mode Brain a Spawn Order of 5. (used for debugging)
3. Write the node graph script shown in the attached image.
4. Test in Forge Play Mode that the script works and prints the same values as in the attached images in Forge.
5. Place two Mode Brains, give one a Spawn Order of 10 and one 20. (used for debugging)
6. Create a Mode Prefab from said brains and set the Mode Variant to "Minigame".
7. Delete the Mode Prefab and save the map.
8. Load the map in Arena:Slayer, mark the ground and observe the correct behavior where the red Primitive Block gets cloned and the killfeed shows relevant data about the objects.
9. Load the map with the saved Forge Mode, mark the ground and observe the issue behavior where the red Primitive Block doesn't get cloned and the killfeed shows that the output object is not a valid object.

## Expected Result

The `Spawn Mode Object` clones the object because it has an object reference that is loaded correctly.

***

## Source Data

* Discord thread: [Spawn Mode Object Node In On-Level Brain Doesn't Work If Map Loaded With a Forge Mode](https://discord.com/channels/220766496635224065/1535589156984725625/1535589156984725625)

#### <mark style="color:green;">Contributors</mark>

Okom


---

# 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://wiki.thescriptersguild.com/knowledge/scripting/bugs/spawn-mode-object-node-in-on-level-brain-doesn-t-work-if-map-loaded-with-a-forge-mode.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.
