# Network Room Player

The Network Room Player stores per-player state for the [Network Room Manager](https://mirror-networking.gitbook.io/docs/manual/components/network-room-manager) while in the room. When using this component, you need to write a script which allows players to indicate they are ready to begin playing, which sets the ReadyToBegin property.

A game object with a Network Room Player component must also have a Network Identity component. When you create a Network Room Player component on a game object, Unity also creates a Network Identity component on that game object if it does not already have one.

![](https://462154250-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MGmQrf2z6FL0ZpExPAn%2F-MUNaRRnCFm7zCiVu-Vo%2F-MUNaVpAEA4qea-n3sYs%2Fimage.png?alt=media\&token=a60e29b2-a999-4b5d-a470-a50e40685e8f)

* **Show Room GUI**\
  Enable this to show the developer GUI for players in the room. This UI is only intended to be used for ease of development. This is enabled by default.
* **Ready To Begin**\
  Diagnostic indicator that a player is Ready.
* **Index**\
  Diagnostic index of the player, e.g. Player 1, Player 2, etc.
* **Network Sync Interval**\
  The rate at which information is sent from the Network Room Player to the server.

## Methods <a href="#methods" id="methods"></a>

### Client Virtual SyncVar Hook Methods <a href="#client-virtual-syncvar-methods" id="client-virtual-syncvar-methods"></a>

```csharp
public virtual void IndexChanged(int oldIndex, int newIndex) { }
public virtual void ReadyStateChanged(bool oldReadyState, bool newReadyState) { }

```

### Client Virtual Methods <a href="#client-virtual-methods" id="client-virtual-methods"></a>

```csharp
public virtual void OnClientEnterRoom() { }
public virtual void OnClientExitRoom() { }
[Obsolete("OnClientReady is deprecated, use the SyncVar ReadyStateChanged hook instead.")]
public virtual void OnClientReady(bool readyState) {}
```


---

# 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://mirror-networking.gitbook.io/docs/manual/components/network-room-player.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.
