Common Mistakes

This is a collection of common mistakes:


NullReferenceException when trying to start a server/host/client

Problem

When trying to start a server, host, or client by executing one of these lines of code

NetworkingManager.Singleton.StartServer()
NetworkingManager.Singleton.StartHost()
NetworkingManager.Singleton.StartClient()

the following exception is thrown:

NullReferenceException: Object reference not set to an instance of an object

Solution

You most likely forgot to add the NetworkingManager component to a game object in your scene.