> 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="/files/jyM9ZL9iQIsZv7kha8hm" 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
