# World Services

{% hint style="success" %}
verified: 2025-11-19 version: v39
{% endhint %}

A common problem we encountered when trying to develop in Unreal without the use of C++ was how to achieve a system similar to "world subsystems". i.e. having a single actor/object in the world that can store state/pass events around without it needing to be an actor explicitly added to a given level. Our solution to this was introducing the "world service" system - allowing you to create objects that exist for the lifetime of the current world, and can easily be obtained globally.

<figure><img src="/files/PeyxvYvqj1mWdYYj3E3D" alt=""><figcaption><p>Example usage of a world service. <code>BPFL_UIModeHelpers</code> interacts with the <code>BP_UIModeService</code> world service, creating it at the point of calling the function if it has not been made already</p></figcaption></figure>

{% hint style="info" %}
Note: If you need state to be replicated, you will need to instead use [Singletons](/platform-documentation/creation/unreal-development/features-and-tutorials/singletons.md)
{% endhint %}

## How to make a world service

Make a blueprint class extending from the `M2_WorldService` class

<figure><img src="/files/TegsnXI90TscA2XgAhPw" alt="" width="563"><figcaption></figcaption></figure>

### Additional events

If you want to have logic that triggers when the service is spun up or spun down, you can override the `NotifyRegistered` and `NotifyUnregistered` events.

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

## How to access your world service

Call the `GetWorldService` function, providing your `WorldServiceClass` created in the above step.

You can choose to set `CreateIfMissing` to true or false. If you want to dynamically create the service at the point that it is needed, set it to true. If you want the service to be created automatically at the start of the project, see [#where-to-set-up-your-world-service](#where-to-set-up-your-world-service "mention")

### Where to set up your world service

#### Create If Missing

If your world service has no "setup" step (i.e. it doesn't need to do any initialization logic on `NotifyRegistered`, the easiest approach is to use `CreateIfMissing`. That way, the world service will be created lazily at the first point that the service is needed (i.e. the first time someone tries to call it or listen to it).

An example usage like this would be the `BP_UIModeService`, which just acts as an intermediary between classes that want to request "UI mode", and a handler class that listens to these requests and actions them.

#### In the World Settings

If you want your world service to be set up as the world is set up, e.g. if it has initialization logic in `NotifyRegistered` that must be run regardless of when other classes need to use the service, you can add the world service to your World Settings.

The web services are examples of this flow - since they need to connect at the start of the game, they register on begin play.

If this is a custom world service, add it to the `AdditionalWorldServices` array.

If you are updating one of the web services, you can override it in its corresponding dropdown.

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


---

# 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://docs.otherside.xyz/platform-documentation/creation/unreal-development/features-and-tutorials/helpers-and-extras/world-services.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.
