> For the complete documentation index, see [llms.txt](https://docs.gmetri.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gmetri.com/metaverse/build/rules/shared-rules.md).

# Shared Rules

When [Multiplayer](/metaverse/multiplayer.md)is turned on, you can keep rule triggering in sync for everyone in the same room by checking the "Shared" checkbox for rules.

A few scenarios where shared rules can be useful are:

* Moving all players to a particular scene at the same time
* Playing a video for everyone
* Keeping a variable in sync for everyone

## Syncing a Variable across Viewers

The following rule basically sets the value of a variable to itself.

`When variable_a changes, Then variable_a should capture data.`

By marking this rule "Shared", we can transmit the value to all players in the room and keep the variable value in sync.

<figure><img src="https://2186043722-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mgll1jjQMRTVj7p6n7g%2Fuploads%2FRpScuGJQz2WiRDs71MYi%2FVariableSync.png?alt=media&amp;token=1b8d6763-5292-41d7-91d6-24ab422a4a98" alt=""><figcaption><p>Keeping a Variable in Sync</p></figcaption></figure>

### Limitations

* Shared rules only trigger the rules. In case there are limitations in the device of the user to actually execute the "Then Action", all end users might not have the same experience.&#x20;
* For example in iOS devices, audio generally plays only on user interaction. Even though you may trigger the "`Then Audio1 should play`" action for everyone, it may not play as not everyone would have touched their screens (or provided the user action that iOS deems necessary to play the audio).
* **Test with you target device to be sure.**


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gmetri.com/metaverse/build/rules/shared-rules.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
