Local testing using Builds

An easy way to test your game locally is to simply create a build, and open several instances of it. Additionally, you can connect using the Editor, with the extra benefit of being able to inspect the hierarchy and the state of its GameObjects.

Pros

  • Easy to distribute amongst team members

  • Well-understood workflow

  • Can test with device-specific constraints (smartphones, consoles, ...)

Cons

  • Not the shortest iteration time, as you need to continuously make builds

  • Harder to debug on the builds (requires custom tooling on your side to do so)

How to use?

Make sure you've read through Local Development and have started a Local Replication Server.

Let's create a standalone build.

Go to Project Settings, Player and change the Fullscreen Mode to Windowed and enable Resizable Window. This will make it much easier to observe standalone builds side-by-side when testing networking.

Open the Build Settings window (File > Build Settings). Click on Add Open Scenes to add the current scene to the build.

Click Build and Run.

Select a folder (e.g. Builds) and click OK.

When the build is done, start another instance of the executable (or run the project in Unity by just hitting Play).

Click Connect in the connection UIs on both clients. Now, try focusing on one and using WASD keys. You will see the box move on the other side as well.