Multiple cameras in multiplayer

I’m having the same kind of problem as the one mentioned here: Cameras in multiplayer game? (Unity) - Questions & Answers - Unity Discussions

So basically, I’m trying to make a multiplayer game, and I’ve set-up the networking using unity. In the network controller, I’ve set the player prefab to be the FPS Controller with a network identity. However, when I try to have two instances of the game running (the host and the client), when the client connects to the host, the host’s camera is switched to the same camera as the client. How do I set it up so that the host and client have different views or cameras? Any help is much appreciated.

Thanks!

Okay, I had the same problem and followed the posts until I could create the following answer.
On the playerprefab being instantiated I placed the following script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class CameraControllerNet : NetworkBehaviour {

    private GameObject cameraRigToGrab;
    public GameObject _cameraPositionMarker; //an empty on my player where the cam should be

    public override void OnStartLocalPlayer()
    {
        cameraRigToGrab = GameObject.Find("OVRCameraRigForCG"); //actually camera's parent
        if (isLocalPlayer)
        {
            cameraRigToGrab.transform.position = _cameraPositionMarker.transform.position;
            cameraRigToGrab.transform.rotation = _cameraPositionMarker.transform.rotation;
            cameraRigToGrab.transform.SetParent(_cameraPositionMarker.transform);

            return;
        }
    }
}

First: You DO NOT unintentionally want more then one Camera in the scene, so simply remove any from prefabs that might generate them automatically and place your ONE MainCamera in the scene alone. My MainCamera in the script below is “OVRCameraRigCG.” Just replace that name with your MainCamera’s parent name. If your MainCamera does not have a parent create an EmptyGameobject as it parent, name it MainCameraRig and reference that name exactly.

The script essentially says:

  1. Find the camera in the scene that I want.
  2. Move that camera to the position and rotation of my CameraMarker
    // this is an empty Gameobject on the playerprefab where you want you camera to be
  3. Make the CameraMarker my camera’s new parent

Hope that helps. It tests out working so far.