This document describes steps to converting a single player game to a multiplayer game, using Mirror. The process described here is a simplified, higher level version of the actual process for a real game; it doesn’t always work exactly like this, but it provides a basic recipe for the process.
## NetworkManager set-up
- Add a new GameObject and rename it “NetworkManager”.
- Add the NetworkManager component to the “NetworkManager” GameObject.
- Add the NetworkManagerHUD component to the GameObject. This provides the default UI for managing the network game state.
See Using the NetworkManager.
## Player Prefab Setup
- Find the Prefab for the player GameObject in the game, or create a Prefab from the player GameObject
- Add the NetworkIdentity component to the player Prefab
- Check the LocalPlayerAuthority box on the NetworkIdentity
- Set the `playerPrefab` in the NetworkManager’s Spawn Info section to the player Prefab
- Remove the player GameObject instance from the Scene if it exists in the Scene
See Player Objects for more information.
## Player Movement
- Add a NetworkTransform component to the player Prefab
- Update input and control scripts to respect `isLocalPlayer`
- Fix Camera to use spawned player and `isLocalPlayer`
For example, this script only processes input for the local player: