For information about deploying to the cloud, see Deploying to the cloud.
Deploy from the command line
To deploy from the command line:
- Open a terminal and navigate (
cd) to the root directory of your project.
spatial local launch
spatial local launch <launch configuration>
launch configurationspecifies the launch configuration file you want to use. For example,
development.json. For information about this file, see the launch configuration page.
spatial local launch --helpfor more information.
Deploy from Unity
- In the Unity Editor, open the SpatialOS window (
Window > SpatialOS).
Run SpatialOS locally, click
This opens a console running
spatial local launch.
Connect a client
Connect a client from Unity
Once the deployment is running, to connect a Unity client:
In Unity, open
workers/unity(or the directory that contain the Unity client), and open the scene
At the top, click Play ▶.
The scene will open, looking something like this:
Connect clients (and other workers) from the command line
You can connect any type of worker to a local deployment from the command line.
To do this, use:
spatial local worker launch <worker type> <launch_config>
worker type: the type of the worker. For example,
launch_config: the launch configuration file.
spatial local worker launch --help for more information.
For example, to start a
UnityClient using the
default launch configuration, run
spatial local worker launch UnityClient default
When successful, you will see the new Unity client worker at http://localhost:21000/inspector.
Stop a local deployment
spatial local launch is running, use
Ctrl + C to stop it.
There’s a known issue where Ctrl + C sometimes doesn’t properly stop all processes. See this forum post for fixes and workarounds.