> For the complete documentation index, see [llms.txt](https://docs.coherence.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coherence.io/2.3/getting-started/how-to.md).

# Frequently asked questions

<details>

<summary>How to stablish a connection</summary>

For a ready-to-use solution, use the Sample UIs accessible from within the coherence Hub. These samples showcase how to connect using Rooms or Worlds, and create connections with a local Replication Server and with a coherence Cloud hosted Replication Server. Otherwise refer to the [Getting Started](/2.3/getting-started/setup-a-project.md) section or [Replication Server API](/2.3/manual/replication-server/replication-server-api.md) documentation.

</details>

<details>

<summary>Can't stablish a connection</summary>

* Is a [Replication Server](/2.3/manual/replication-server.md) running?
* Is the Replication Server using the same schema as your project?
  * Ensure you have [baked](/2.3/manual/baking-and-code-generation.md).
  * For local RS, shut down the the Replication Server and launch it again.
  * For cloud RS, ensure you have uploaded the schema to the cloud, then retry.
* Are you on Windows and have text selected in the Command Prompt that is running the Replication Server?
  * Press **Esc** with the Command Prompt having focus to clear any selected text and resume the application.
  * You can also disable the **Quick Edit Mode** in **Command Prompt's Properties** to make it more difficult to accidentally select text. You will then need to select **Edit > Mark** (or press **Ctrl + M**) before you can select text.

</details>

<details>

<summary>How to spawn my Player Prefab</summary>

There is no specific "instantiate my player prefab" logic built-in. Any script can instantiate it. You can listen to `CoherenceBridge`'s `onConnected` or `onLiveQuerySynced` events to do your `Instantiate(playerPrefab)`. No calls to any coherence-specific APIs — just a regular `Instantiate`.

</details>

<details>

<summary>How to spawn or destroy a Networked Prefab</summary>

Spawning is done by simply instantiating a prefab that has a CoherenceSync component on it, by using Unity's `Instantiate()` API. Same for removing entities, `Destroy()` the GameObject. Read more about [instantiating and destroying](/2.3/manual/networking-state-changes/instantiate-and-destroy-objects.md).

</details>

<details>

<summary>How to sync a variable</summary>

You can sync variables on any component attached to a prefab via CoherenceSync component inspector. Click on the Configure button and the Configure window will open. From there, toggle the variables you want to synchronize. These variables will comform the network **state** of the entity.

Only variables of the [supported types](/2.3/manual/networking-state-changes/supported-types.md) can be synchronized currently.

</details>

<details>

<summary>How to find or iterate through other connected clients</summary>

Refer to [Client Connections](/2.3/manual/client-connections.md).

</details>

<details>

<summary>How to invoke a method on a client, or on all of them</summary>

Refer to [Commands](/2.3/manual/networking-state-changes/commands.md).

</details>

<details>

<summary>How to move all connected clients to a new scene together</summary>

To make all connected clients move to a new scene, you can create a method that loads the scene and mark it as a [Command](/2.3/manual/networking-state-changes/commands.md). Send that command to all targets via `MessageTarget.All`. See also [Scene Management](/2.3/manual/scenes.md).

</details>

<details>

<summary>How to run a dedicated server for my game</summary>

Dedicated Servers in coherence are called [Simulators](/2.3/manual/simulation-server.md).

</details>

<details>

<summary>How to do client-side prediction</summary>

[Disable automatic updates](/2.3/manual/networking-state-changes/authority/server-authoritative-setup.md#client-side-prediction) on the variables you want predict. Implement your prediction code, and listen for incoming updates by [hooking into update callbacks](/2.3/manual/networking-state-changes/authority/server-authoritative-setup.md#misprediction-and-reconciliation). When the update arrives, you can reconcile the predicted state and the new, incoming sample in a way that fits your game best.

</details>

<details>

<summary>How to create a chat system</summary>

To create a [simple in-game chat](/2.3/getting-started/samples-and-tutorials/campfire-project/a-simple-text-chat.md) functionality, you can leverage Commands to send strings (or byte arrays) to all connected Clients.

A pre-game chat can also be created by leveraging [Lobbies](/2.3/hosting/coherence-cloud/game-services/lobbies.md).

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.coherence.io/2.3/getting-started/how-to.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.
