This document describes steps to convert a single player game to a multiplayer game using the new networking system. The process described here is a simplified, higher level version of the actual process for a real game and doesn’t work exactly like this for every game, but it provides a basic recipe for the process.
See Player Objects.
For example, this script only processes input for the local player:
using UnityEngine;
using UnityEngine.Networking;
public class Controls : NetworkBehaviour
{
void Update()
{
if (!isLocalPlayer)
{
// exit from update if this is not the local player
return;
}
// handle player input for movement
}
}
See Networked Actions.
Fix non-player prefabs such as enemies: