# Create Gamemode

> ## **Important**
>
> Spawn and respawn actions are already configured by default in the `GameData` when it is created.
>
> If you want to implement your own custom spawn or respawn logic entirely in code, make sure to remove the corresponding events from the `GameData`. Otherwise, both systems may run at the same time.\
> \
> ![](/files/mNhHnOHqx5qkJlw4nqiv)<br>

This guide covers how to create a new **Game Mode Mod** in the Reality Modkit and configure its data assets, phases, and optional features.

***

## Creating the Game Mode Mod

{% stepper %}
{% step %}

### Create the mod

* Open the **Reality** dropdown menu in the Unreal Editor.
* Click **New Mod**.
* Set the **Type** to **GameMode**.
  {% endstep %}

{% step %}

### Assign the GameMode asset

* From the content browser open the GameMode and in the class defaults, assign a **Data Asset** for your game mode.
* The data asset class must be of type **`RealityGameData`**.
  {% endstep %}
  {% endstepper %}

***

## Setting Up the Data Asset (RealityGameData)

The **RealityGameData** asset defines the rules, structure, and flow of your game mode. It includes options for gameplay logic, teams, phases, and UI behavior.

### Data Asset Fields

| Field                 | Description                                                                                                                                                                                                                             |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Game Widget Class** | Optional. A custom UI widget that appears on the **Reality Control Device (Tablet)** alongside the built in menu.                                                                                                                       |
| **Phases**            | <p>A list of <strong><code>RealityGamePhase</code></strong> assets defining the structure of the match (e.g., warm-up, rounds, end game).<br>Phases execute <strong>in order</strong> as listed. The order matters for transitions.</p> |

***

## Game Phases

Phases define the **sequence of gameplay flow**, such as Warm-Up, Rounds, or End Game.

Each phase is represented by a **`RealityGamePhase`** asset.

### Premade Phases

| Phase Name           | Description                                  |
| -------------------- | -------------------------------------------- |
| **Game\_WarmUp**     | Currently doesn't have any predefined logic. |
| **Game\_PlayTDM**    | Currently doesn't have any predefined logic. |
| **Game\_End**        | Currently doesn't have any predefined logic. |
| **Round\_TDM\_Buy**  | Currently doesn't have any predefined logic. |
| **Round\_TDM\_Play** | Currently doesn't have any predefined logic. |

***

## Phase Structure

Each **RealityGamePhase** supports logic, conditions, and optional repetition.

### Default Variables

| Variable       | Description                                                                                 |
| -------------- | ------------------------------------------------------------------------------------------- |
| **Name**       | Identifier used for reference in other Blueprints.                                          |
| **Duration**   | How long the phase lasts (in seconds). Can be infinite if conditions handle the transition. |
| **Iterations** | How many times this phase repeats before continuing to the next one.                        |
| **Tags**       | Metadata for identifying or filtering phases.                                               |

### Functions

Each phase exposes two overridable events:

* **OnBegin()** – Called when the phase starts.
* **OnEnd()** – Called when the phase ends.

### Actions & Conditions

* **Actions** are objects of class `RealityFunction` (child of `UObject`) executed when a phase **begins** or **ends**.
* **Conditions** are objects of class `RealityCondition` (child of `UObject`) that control **when the phase transitions**.
* Phases can also have **time limits** or multiple **subphases**.
* You can configure:
  * A list of **OnBegin Actions**
  * A list of **OnEnd Actions**
  * A list of **Transition Conditions**

***


---

# Agent Instructions: 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://beyond-sandbox.gitbook.io/realitysdk/documentation/gamemode/create-gamemode.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.
