# Multiplayer

State Machine 2 provides built-in support for multiplayer games using Photon Fusion or Photon PUN2.

## Requirements

To use multiplayer features, you need one of the following modules installed:

| Module                                                | Networking Solution |
| ----------------------------------------------------- | ------------------- |
| [Fusion Module](/game-creator-2/fusion-module.md)     | Photon Fusion       |
| [Photon Module 2](/game-creator-2/photon-module-2.md) | Photon PUN2         |

{% hint style="info" %}
The multiplayer features in State Machine 2 appear automatically when either module is detected.
{% endhint %}

## Per-Node Network Settings

Each node in a state machine can have individual networking configuration:

1. Select a node in the Graph Editor
2. Expand **Network Settings** in the Inspector
3. Configure the sync options

### Network Options

| Option                 | Description                            |
| ---------------------- | -------------------------------------- |
| **Run on All**         | Execute on all clients                 |
| **Run on Owner**       | Execute only on the owning client      |
| **Run on Master/Host** | Execute only on the host/master client |
| **RPC**                | Send as a Remote Procedure Call        |

## State Synchronization

State Machine 2 automatically handles state synchronization for networked games:

### Node State Sync

* Active node states are synchronized across clients
* Transitions are replicated to maintain consistency
* Late-joining clients receive the current state

### Variable Sync

State Machine variables can be synchronized:

1. Open the **Blackboard**
2. Select a variable
3. Enable **Network Sync** (requires Fusion/Photon Module)


---

# 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.ninjutsugames.com/game-creator-2/state-machine-2/multiplayer.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.
