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
Custom Prefab Objects
This component allows for defining a custom object to be used in Spatial. Custom prefab objects let you create any type of interactive object that can be loaded into the space, like furniture, vending machines, vehicles, interactive jukeboxes, etc. These can be interacted with using your avatar or even other custom objects. This is to be used in conjunction with the
Prefab Object
package type, which you can reference in the package configuration.How To Use
Find examples of prefab objects in the Starter Template
Setting up a prefab object is almost as easy as creating prefabs in Unity.
- First, start by creating your custom object as a Unity Prefab, and add the
Spatial Prefab Object
component to the root GameObject. You may add additional effects, like particle systems or audio sources, if you would like. Creating a custom object without any visuals is not recommended since the avatar will not be able to interact with it. - Once you have your prefab ready, create a new “PrefabObject” package
- Then, give it a name (this name will be what shows up in the content menu / inventory inside the Spatial app) and drag the prefab you created in step 1 into the
Prefab
field. - You will also need to specify a thumbnail of size exactly
512x512
in an uncompressed format - To test this package, make sure it is the “active package” inside the project configuration panel and then press the
Test Active Package
button inside the main toolbar.
When creating your prefab, be sure to set its Position to 0, 0, 0. Otherwise, you’ll encounter odd behavior when attempting to place it in a space.
Limitations
These limitations are subject to change at any time
Currently there are very few limitations on what you can do with prefab objects, but we may introduce new rules in the future.