Getting Started

Introduction

Installation

Project Configuration

Testing in Your Sandbox

Samples & Examples

Core Concepts & Glossary

Package Types

Spaces & Space Templates

Custom Avatars

Custom Avatar Animations

Avatar Attachments

Custom Prefab Objects

Embedded Packages

Drivable Vehicles

Scene Setup

Testing In Unity vs Sandbox

Controlling the Camera

Custom Collision, Layers, and Tags

Audio Mixers and Groups

Key Differences from Standard Unity3D development

Economy

Quests and Rewards

Economy Overview

Monetization

Items

Consumable Items

Rewarding Items

World Currency

Selling Items

Scripting

Components

Entrance Point

Camera Passthrough

Interactable

Trigger Event

Point Of Interest

Environment Settings Overrides

Render Pipeline Settings Overrides

Movement Materials

Climbable

Avatar Teleporter

Empty Frame

Projector Surface

Seat Hotspot

Guidelines

Supported Features and Limitations

Performance Guidelines

Lighting

Publishing to Spatial

Finding Published Packages

Support

FAQs

Help and Support

Release Notes

Asset Import Settings

Synced Object

<aside> ⚠️ This is an experimental component, It is likely to receive large changes in the future!

</aside>

<aside> <img src="/icons/hand_red.svg" alt="/icons/hand_red.svg" width="40px" /> Before using the synced object component make sure to familiarize yourself with Spatial Netcode.

</aside>

<aside> <img src="/icons/book_gray.svg" alt="/icons/book_gray.svg" width="40px" /> The synced object component lets you mark a scene object or prefab as “synced”. This causes the objects transform, lifetime, and custom variables to be synced across all clients in a space.

</aside>

Untitled

Embedded vs Prefab

<aside> <img src="/icons/light-bulb_blue.svg" alt="/icons/light-bulb_blue.svg" width="40px" /> Synced objects can either be embedded in a scene or be instantiated as a prefab using visual scripting. The core behavior of the component acts the same between the two, but the following properties have slightly unique behavior depending on how the object is created.

</aside>

Properties

Property Function
Sync Transform If enabled the objects transform will be synced across all connected clients.
Save With Space Checked:
The state of the object will remain consistent across sessions. A new session starts when a user joins an empty space. As long as one users is connected to a space the session will continue.

Unchecked: Embedded scene objects When a new session starts embedded scene objects will always be instantiated, even if they where deleted in a previous session.

Instantiated prefab When a session ends all instantiated prefabs will be deleted. | | Destroy on Creator Disconnect | * Only relevant for objects instantiated as a prefab through visual scripting If checked, the object will be destroyed for all clients when it’s creator disconnects. Note an objects creator does not equal its owner. |

Synced Variables

<aside> <img src="/icons/code_gray.svg" alt="/icons/code_gray.svg" width="40px" /> You can optionally enable synced variables on your synced object. This allows you to keep Visual Scripting variables synced on the same object.

Synced Variables follow the same ownership rules as the transform.

Only bool , int , float , string , Vector2 , and Vector3 can be synced.

Untitled

</aside>

How To Use

<aside> <img src="/icons/cursor-click_gray.svg" alt="/icons/cursor-click_gray.svg" width="40px" /> Embedded scene objects Creating an embedded synced object is as simple as just adding a Synced Object component to any of your scene objects. From the hierarchy view you can easily see which objects are synced by looking for the sync icon on the side.

Untitled

Prefab Objects Creating a synced prefab object is just as easy but requires a few extra steps. First we need to create a prefab that has a Synced Object component on the root object like so:

Untitled

This prefab can live anywhere in your project folder.

To instantiate this prefab you can simply use the GameObject.Instantiate node like normal. Spatial will make sure the object gets instantiated on all other connected clients and syncs properly.

Untitled

</aside>

Limitations

<aside> <img src="/icons/no-entry_red.svg" alt="/icons/no-entry_red.svg" width="40px" /> Only the LOCAL transform is synced If you re-parent a synced object on one client, that change will not propagate to the other. The synced object will still behave “normally”, but it’s position might become de-synced since it will be relative to its parent.

</aside>

<aside> <img src="/icons/no-entry_red.svg" alt="/icons/no-entry_red.svg" width="40px" /> A synced object can not be a child of another synced object

</aside>

← Previous

Synced Animator

Next →

Supported Features and Limitations