Sync Helpers
Four small components that cover jobs you would otherwise write a script for: showing an object once the network is ready, showing different objects to the owner, rendering a synced value into text, and inspecting an entity while debugging.
Set Enabled On Ready
Enables one set of objects once its target is ready and a different set before then. Use it so gameplay UI does not appear before the session can serve it.
| Name | Type | Description |
|---|---|---|
| Target Type | Sync Entity or Network Root | What readiness is measured against. Defaults to Sync Entity. |
| Sync Entity Script | ScriptComponent | Shown when Target Type is Sync Entity. The script whose entity to watch. |
| Ready Objects | SceneObject[] | Enabled once ready. |
| Not Ready Objects | SceneObject[] | Enabled until ready. |
Despite the label, Network Root gates on the
Session Controller being ready, not on a network
root. Pick it when you mean "wait for the session," and Sync Entity when you
mean "wait for this specific entity."
Set Enabled If Owner
Enables one set of objects for the client that owns the entity and a different set for everyone else. This is how you give the owner a control UI while remote clients see only the visuals.
| Name | Type | Description |
|---|---|---|
| Target Type | Sync Entity or Network Root | What ownership is read from. Defaults to Sync Entity. |
| Sync Entity Script | ScriptComponent | Shown when Target Type is Sync Entity. |
| Owner Objects | SceneObject[] | Enabled for the owner. |
| Non Owner Objects | SceneObject[] | Enabled for everyone else. |
It re-evaluates when ownership changes, so it keeps up if the owner leaves and another client takes over.
Display Storage Property
Renders a storage property into a Text component,
with an optional format string. Useful for a score or timer readout with no
glue code.
| Name | Type | Description |
|---|---|---|
| Sync Entity Script | ScriptComponent | The script whose entity holds the property. |
| Property Key | string | The property key to display. |
| Text | Text | The text component to write into. |
| Use Format | boolean | Enables the format string. Defaults to false. |
| Format String | string | Shown when Use Format is on. Supports {value} for the current value and {prevValue} for the previous one; either is blank when unset. |
| Alt Text | string | Shown when the value is undefined. |
Sync Entity Debug
Writes an entity's network id, owner, and full store contents into Text
components. A debugging aid, not something to ship.
| Name | Type | Description |
|---|---|---|
| Target Type | Sync Entity or Network Root | Which target to inspect. Defaults to Sync Entity. |
| Sync Entity Script | ScriptComponent | Shown when Target Type is Sync Entity. |
| Network Id Text | Text (optional) | Receives the network id. |
| Owner Display Name Text | Text (optional) | Receives the owner's display name. |
| Show Only First Name | boolean | Trims the owner name to the first name. |
| Owner Id Text | Text (optional) | Receives the owner id. |
| Storage Property Text | Text (optional) | Receives the full store contents. |
This component prints session and user information on screen. Disable or delete
it before you publish, the same way the
starter project marks its debug camera
[DISABLE ME].
Related
- Sync Entity
- Storage Property
- Multiplayer Response: for gating on session state instead.