Worker Configuration

When running Unity through the CLI, it is also possible to configure the Worker Connection settings through the arguments and flags defined in the Unity GDK.

In the SpatialOS GDK for Unity, you can use GDK-specific command line arguments to customize how the GDK runs. For example, you can specify how a worker instance connects to a deployment or choose which network stack a worker instance uses to communicate with the SpatialOS Runtime.

Connection arguments

You can use one of the following methods to connect a worker instance to a SpatialOS deployment:

Use the Receptionist to connect a client-worker or server-worker instance to a local or cloud deployment.
Use the Locator to connect a client-worker instance to a cloud deployment.

Each time you connect one worker instance to a deployment, you can choose only one method for connection. You might need to add both general connection arguments and method-specific arguments.

When you use either method to connect a worker instance to a deployment, you can add the following general connection arguments:

Argument Type Default Description
linkProtocol [Arg] string ModularTCP The network connection type to use, e.g. TCP, KCP, etc. See Network Stack for more
workerId [Arg] string nil The worker ID to use for the worker connection that will be created when CreateAsync is called.
useExternalIp flag unset Set this flag to allow the worker to connect to an external IP. This is typically used in two cases:
  • To connect to a deployment on a different machine from the worker instance’s machine (not hosted in the cloud).
  • To connect to a cloud deployment using

Receptionist service arguments

When you connect a client-worker or server-worker instance to a deployment without the authentication flow, you can add the following Receptionist arguments before you launch the deployment:

If you specify both Receptionist arguments and Locator arguments to connect one worker instance to a deployment, errors might occur.

Argument Type Default Description
receptionistHost [Arg] string 127.0.0.1 The IP address of the Receptionist to use when connecting.
receptionistPort [Arg] string 7777 The port of the Receptionist to use when connecting.

Locator service arguments

The following arguments enable the client-worker to connect to a deployment through the player authentication service.

Argument Type Default Description
locatorHost [Arg] string locator.improbable.io The host of the Locator to use for the development authentication flow and the Locator.
playerIdentityToken [Arg] string nil The player identity token to use to connect via the Locator.
loginToken [Arg] string nil The login token to use to connect via the Locator.

Updated about a year ago


Worker Configuration


When running Unity through the CLI, it is also possible to configure the Worker Connection settings through the arguments and flags defined in the Unity GDK.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.