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. Image showing a configured collision matrix in the Unity project settings

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:

public static class Layers
{
public static readonly int Enemies = 6;
public static readonly int Projectiles = 7;
public static readonly int Explosions = 8;
}
public static class Layers
{
public static readonly int Enemies = 6;
public static readonly int Projectiles = 7;
public static readonly int Explosions = 8;
}

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. Image showing the use of a tag which Spatial does not support