# Actions

The **Photon** module comes with a set of **Actions** that complement **Game Creator**'s. All actions can be used on any other module

{% hint style="warning" %}
Most of the Actions won't work if you are not connect to the Photon Service unless you have **offline mode** activated.
{% endhint %}

## Synchronizing Actions

Synchronizing Actions it's just as easy as a single click. Once the module it's installed you will notice a new tab called "**Network Settings**" below the *Action's Inspector* in order to make this work just go ahead and enabled the option "**Sync Actions**" that's pretty much it (well that was actually 2 clicks).

{% hint style="warning" %}
This requires to be within a **room** to work. Nothing happens if not.
{% endhint %}

{% hint style="danger" %}
If you are *synchronizing* **actions** some times you might need to use target **Invoker** instead of **Player**
{% endhint %}

![(Example of the built-in sync actions inspector)](/files/-LGavib9mq5LGCYHViqP)

Once you enabled **Sync Actions** you can select the [targets](https://njg.gitbook.io/gc-modules/~/drafts/-LGavgvIRvIu9eDV2NNm/primary/photon-network/photon-network/overview#targets) you want to synchronize with.

{% hint style="info" %}
Notice that this will add a **Photon View** component to the game object.
{% endhint %}

## Action Photon Connect <a href="#action-photon-connect" id="action-photon-connect"></a>

Allows you connect to the Photon Service, parameters:

* **Game Version**: this client's version number. Users are separated from each other by game version (which allows you to make breaking changes).
* **Methods:** this action allows you to connect using 3 different method types:
  * **UsingSettings**: Connect to Photon as configured in the PUN settings
  * **Region**: Connects to the Photon Cloud region of choice.
  * **BestCloudServer**: Connect to the Photon Cloud region with the lowest ping.

![](/files/-LIP7ugC5WIAI5_HCZe5)

{% hint style="danger" %}
Connecting to the **Photon Cloud** might fail due to:

\- **Invalid AppId** calls: OnFailedToConnectToPhoton. check exact AppId value

\- **Network issues** calls: OnFailedToConnectToPhoton

\- **Invalid region** calls: OnConnectionFail with DisconnectCause.InvalidRegion

\- **Subscription CCU limit reached** calls: OnConnectionFail with DisconnectCause.MaxCcuReached. also calls: OnPhotonMaxCccuReached
{% endhint %}

## Actions Photon Disconnect <a href="#actions-photon-disconnect" id="actions-photon-disconnect"></a>

Makes this client disconnect from the photon server, a process that leaves any room and calls OnDisconnectedFromPhoton on completion.

![](/files/-LIP7x4vR2wORdGbJJPy)

## Action Photon Instantiate <a href="#action-photon-instantiate" id="action-photon-instantiate"></a>

Instantiate a prefab over the network. There is 2 types of instantiations:

* **Player Object**: the owner of the object is the player. Normally when player disconnects all instantiated player objects will be destroyed.
* **Scene Object**: the owner of the object is the scene. The object will always be there unless someone destroys it.

![](/files/-LIP8-WLiXN344C-XgxY)

{% hint style="warning" %}
This prefab needs to be defined in **Prefabs list** from **Photon Preferences Settings** or located in the root of a "Resources" folder.
{% endhint %}

## Action Create Room <a href="#action-create-room" id="action-create-room"></a>

![](/files/-LIP83vDlgDmKxMpNuuW)

## Action Join or Create Room <a href="#action-join-or-create-room" id="action-join-or-create-room"></a>

![](/files/-LIP86DhCbZmFWMSbLO9)

## Action Join Room <a href="#action-join-room" id="action-join-room"></a>

![](/files/-LIP88h5odYwWRi3fxV-)

## Action Kick Player <a href="#action-kick-player" id="action-kick-player"></a>

![](/files/-LIP8JfJKWlIOUYMfhzK)

## Action Leave Room <a href="#action-leave-room" id="action-leave-room"></a>

![](/files/-LIP8Li0FF-4gzaQeOQ5)

## Action Reconnect <a href="#action-reconnect" id="action-reconnect"></a>

![](/files/-LIP9SIftGyGt3_QEhSR)

## Action Reconnect and Rejoin <a href="#action-reconnect-and-rejoin" id="action-reconnect-and-rejoin"></a>

![](/files/-LIP9_hdnfNhpZAY0g5i)

## Action Rejoin Room <a href="#action-rejoin-room" id="action-rejoin-room"></a>

![](/files/-LIP9fVHGFkLcG3RK_5j)

## Action Send Photon RPC <a href="#action-send-photon-rpc" id="action-send-photon-rpc"></a>

![](/files/-LIPA2ZPMy7J1qpprCwg)

## Action Score <a href="#action-score" id="action-score"></a>

![](/files/-LIPA5sAZzGznsTLHvz9)

## Action Player Property <a href="#action-player-property" id="action-player-property"></a>

![](/files/-LIPACReLWsfC4Y0u7z4)

## Action Room Property <a href="#action-room-property" id="action-room-property"></a>

![](/files/-LIPAFI6d8xPfgPT4qNj)

## Action Start Timer

![](/files/-LIPASbjfziloTSVDFJN)

## Action Photon Change Text

![](/files/-LIR4lS7mwRMqyD94nE6)


---

# 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-1/photon-network/actions.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.
