How do I make a camera look for a specific GameObject while networking?

Hi! I just fixed with networking and now I’ve finally been able to connect myself up globally. However, there’s a problem. I have no idea, whatsoever how I will get a specific instantiated camera to follow a specific instantiated gameobject. I am using the camerafollow script as following:

`using UnityEngine;
using System.Collections;

public class SmoothCam : MonoBehaviour {
public float mFollowRate = 1f;
public float mFollowHeight = 20f;
public Transform target;

void Start(){
	if(!networkView.isMine)
		enabled = false;
}

void LateUpdate () {

if(networkView.isMine)

transform.position = Vector3.Lerp(  transform.position, 
                       target.position + 
                       new Vector3(0f, (mFollowHeight - target.position.y), 0f), 
                       Time.deltaTime * mFollowRate);
}

}`

So. Exactly how will I make my specific camera, when instantiated follow the specific instantiated GameObject?

This might be what you’re looking for.

foreach(Camera cam in GameObject.FindObjectsOfType(typeof(Camera)))
{
    if(cam.tag == "myTag" && cam.networkView.isMine == true)
    {
        target = cam;
        Debug.Log("Target is set to: " + cam.name);
    }
}

This has worked for me in the past.