Getting Started
Package Types
Scene Setup
Custom Collision, Layers, and Tags
Key Differences from Standard Unity3D development
Economy
Scripting
C# Scripting
Visual Scripting
Sync and Multiplayer
Components
Environment Settings Overrides
Render Pipeline Settings Overrides
Guidelines
Supported Features and Limitations
Support
In order to maintain compatibility with all our platforms and to create a secure experience only specific allow-listed APIs can be used in Spatial.
If you try to use an unsupported API you will be notified in the issues tab and blocked from uploading.
C# scripts are currently available for Spaces made using the Spatial Creator Toolkit. Other types of content do not support scripting.
Currently we support a significant portion of APIs in the following modules
mscorlib
UnityEngine.CoreModule
UnityEngine.AudioModule
UnityEngine.PhysicsModule
UnityEngine.AnimationModule
UnityEngine.UIModule
UnityEngine.UI
Unity.TextMeshPro
Some Unity API’s are very important but need to be partially restricted, or modified to operate safely inside spatial. The replacements are as follows.
Application.OpenURL
⇒ SpatialBridge.spaceService.OpenURL
Camera.Main.___
⇒ SpatialBridge.cameraService
We can’t list all 5000+ currently blocked API calls here… but here are some common ones we have blocked:
Use of the unsafe
Keyword
Editor scripts ⇒ allowed, as long as you move them to a Editor
folder or use a #if UNITY_EDITOR
directive
Most Application
APIs like Application.OpenURL
Any SendMessage
variant
Any System.Reflection
APIs
System.IO.File
System.IO.Directory
and any APIs dealing with the file system
Any Scene
or SceneManagement
related APIs — use alternate strategies instead
DontDestroyOnLoad
— interferes with object lifecycles
TimeScale
Time.fixedTimeDelta (setter)
maxDeltaTime
— no modification of time settings
DestroyImmediate
— use Destroy
instead
PlayerPrefs
— use the Spatial SDK DataStore
instead
Resources
— use AssetBundle
instead
Camera.main
Camera.allCameras
Camera.current
— use the Spatial SDK Camera APIs instead
Networking APIs (UnityWebRequest
www
)
QualitySettings
See Excluding Editor code for how you can mix Editor-only code inside the directory that contains your C# runtime scripts.
If you need functionality of a certain API that is not supported definitely let us know! We might be able to expand our supported APIs or write similar functionality in a Spatial-unique API.
The best place to give this kind of feedback directly to the team is the Creator Toolkit section of the Spatial Discord
← Previous
Next →