Managing Collisions
Spatial requires the objects in your scene’s to be on certain layers. Specifically, only layers 6 - 14
and 31
are allowed. The Effective Layer section will show you what layer your game-object will be set to when loaded in Spatial and gives you a drop-down of all the supported layers.
Customizing Collision
To customize your space's collision settings navigate to your Project Settings
then open the Physics
tab. Here you can enable or disable any of the collision settings for the layer pairs highlighted in the image below.
Do Not Use Name to Layer Functions
The names of your layers are not preserved when loaded in Spatial which means NameToLayer functions will most likely return -1
.
Instead you should always reference your layers in code by their integer values. It's recommended to manage your layers in a static class like shown below:
Tags Are Not Supported
Although tags appear as just strings
, they function roughly the same as layers with an ID
. When Spatial loads your bundle all the tags on your objects will be converted to the corresponding tag in the internal Spatial project.
Unfortunately this is a limitation imposed by the unity engine, so we recommend you ignore them completely.