Spatial Type

Spatial Type (SpatialType) is a SpatialOS-specific class specifier (Unreal documentation). The GDK uses SpatialType to expose network-relevant class information to SpatialOS.

SpatialType is similar to other Unreal class specifiers, but implemented in parallel with EClassFlags (Unreal documentation) to minimize the possibility of conflicting changes between the standard Unreal Engine and the GDK’s Unreal Engine fork.

The SpatialType tag allows the GDK to interoperate between the network stacks of native Unreal and SpatialOS. The tag is inherited down class hierarchies.

Classes with automatic SpatialType tagging

By default all classes are tagged with SpatialType. This ensures the GDK inspects all loaded classes and generates schema for them if they have any properties tagged with Replicated or Handover, or they have RPC functions. If you don’t wish your class to be considered a SpatialType you can opt out using the NotSpatialType tag.

Classes which need manual SpatialType tagging

You need to manually tag as SpatialType any classes which are Singleton Actors or only accessible to server-workers. These classes also need SpatialType descriptors.

SpatialType descriptors

You can add descriptors to the SpatialType tag to define additional information SpatialOS needs to know about your Unreal class. These are:

  • Singleton: this indicates this class should be treated as a Singleton.
  • ServerOnly: this indicates this class is only relevant to server-workers. You can use this descriptor in conjunction with the Singleton descriptor to indicate that this class is a Private Singleton.

How to manually tag classes as SpatialType

Adding the specifier and descriptors to your Unreal C++ class

Like other Unreal class specifiers, you specify the SpatialType and descriptors within your class’s UCLASS macro.

For example;

class AMyReplicatingActor : public AActor

To add SpatialType descriptors, use the following format;

class AMySingleton : public AActor

Adding the specifier and descriptors to your Unreal Blueprint class

You can also tag your Blueprint classes with the SpatialType tag and descriptors. To do this,

  1. Open the class in the Blueprint Editor and, from the menu, select Class Settings.
  2. Ensure that the Spatial Type checkbox is selected.
  3. Add any descriptors to the Spatial Description textbox, like so:


Search results

Was this page helpful?

Thanks for letting us know!

Thanks for your feedback

Need more help? Ask on the forums